selenium 2.53.1 firefox 47.0.1
firefox 自带WebDriver,只需指定安装目录位置
chrome需要自行下载ChromeDriver.
/**
*
*/
package com.luran.test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
/**
* @author luran
* @date 2016-8-12 下午5:26:23
*/
public class Test1 {
public static void main(String[] args) {
System.setProperty("webdriver.firefox.bin","D:\\Program Files\\Mozilla Firefox\\firefox.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.autohome.com.cn/car");
// 获取 网页的 title
System.out.println("1 Page title is: " + driver.getTitle());
}
}