我想做个小外挂,可以自动打开网页,点击某些固定链接,很简单的

TVBee 2014-02-26 07:00:36
不知道我应该学点什么呢,用什么环境呢
哪位大哥帮指点一下哈,谢谢了
如果推荐本书就更好了。
...全文
1217 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
TVBee 2014-03-01
  • 打赏
  • 举报
回复
引用 3 楼 zhongxianyao 的回复:
点击链接也就是发送请求而已,java和.Net应该就可以了,容易上手
对了,因为这个网站是更新的,我需要判断更新的内容,另外还需要登际我的账号哈哈。但是我感觉应该是很简单的事情吧
TVBee 2014-03-01
  • 打赏
  • 举报
回复
引用 3 楼 zhongxianyao 的回复:
点击链接也就是发送请求而已,java和.Net应该就可以了,容易上手
对对亲我就是这个意思,我具体应该看哪一部分内容呢,我会php,有点基础。我就想学专门的那一块哈哈,亲给点指点,我爱死你了谢谢哈
blmdlm 2014-03-01
  • 打赏
  • 举报
回复
对于这种会涉及到指针位置,而且只是在桌面上进行操作。建议用封装比较向上的,如易语言等。足以胜任征途等网游自动升级打怪收菜外挂的编写。
vainca 2014-02-28
  • 打赏
  • 举报
回复
public class SeleniumTest { protected WebDriver driver; @Before public void setUp() { System.setProperty("webdriver.ie.bin","C:\\Program Files\\Internet Explorer\\iexplore.exe"); try{ driver= new InternetExplorerDriver(); // driver = new FirefoxDriver(); }catch (Exception e) { e.printStackTrace(); } } @After public void cleanUp() { // Close the browser driver.quit(); } @Test public void search() { //DefaultSelenium selenium = new DefaultSelenium( "localhost" , 4444, "*firefox D:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe","http://www.baidu.com"); driver.get("http://www.baidu.com"); // Alternatively the same thing can be done like this // driver.navigate().to("http://www.google.com"); // Find the text input element by its id WebElement element = driver.findElement(By.name("wd")); // Enter something to search for element.sendKeys("Cheese!"); // Check the title of the page System.out.println("Page title is: " + driver.getTitle()); // Now submit the form. WebDriver will find the form for us from the element driver.findElement(By.id("su1")).click(); //element.submit(); // Baidu's search is rendered dynamically with JavaScript. // Wait for the page to load, timeout after 20 seconds (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver driver) { return driver.getTitle().toLowerCase().startsWith("cheese!"); } }); // Should see: "Cheese!_百度搜索" System.out.println("Page title is: " + driver.getTitle()); } } 楼上的我试了下有问题!改了一下可以用
长笛党希望 2014-02-27
  • 打赏
  • 举报
回复
用Selenium可以实现楼主需求,就是一个测试软件。。。
Inhibitory 2014-02-27
  • 打赏
  • 举报
回复
用Java的测试工具:Selenium + JUnit 可以打开网页,点击网页上的链接。
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.safari.SafariDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

public class SeleniumTest {
    protected WebDriver driver;

    @Before
    public void setUp() {
        driver = new SafariDriver();
    }

    @After
    public void cleanUp() {
        // Close the browser
        driver.quit();
    }

    @Test
    public void search() {
        // And now use this to visit Baidu
        driver.get("http://www.baidu.com");
        // Alternatively the same thing can be done like this
        // driver.navigate().to("http://www.google.com");

        // Find the text input element by its id
        WebElement element = driver.findElement(By.id("kw"));

        // Enter something to search for
        element.sendKeys("Cheese!");

        // Check the title of the page
        System.out.println("Page title is: " + driver.getTitle());

        // Now submit the form. WebDriver will find the form for us from the element
        // driver.findElement(By.id("su")).click();
        element.submit();

        // Baidu's search is rendered dynamically with JavaScript.
        // Wait for the page to load, timeout after 20 seconds
        (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver driver) {
                return driver.getTitle().toLowerCase().startsWith("cheese!");
            }
        });

        // Should see: "Cheese!_百度搜索"
        System.out.println("Page title is: " + driver.getTitle());
    }
}
编程点滴 2014-02-26
  • 打赏
  • 举报
回复
点击链接也就是发送请求而已,java和.Net应该就可以了,容易上手
程序员一灯 2014-02-26
  • 打赏
  • 举报
回复
httpclient
teemai 2014-02-26
  • 打赏
  • 举报
回复
直接按键精灵吧

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧