public static void main(String[] args) {
//指定firefox浏览器的 启动路径
System.setProperty("webdriver.fireFox.bin","C:\\Program Files (x86)\\Mozilla Firefox\\firebox.exe");
//指定geckodriver的 启动路径
System.setProperty("webdriver.gecko.driver","C:\\Program Files (x86)\\Mozilla Firefox\\geckodriver.exe");//C:\\Program Files (x86)\\Mozilla Firefox\\geckodriver.exe是驱动放置的位置
WebDriver driver = new FirefoxDriver();
// 访问百度
driver.get("http://www.baidu.com");
// Alternatively the same thing can be done like this
// driver.navigate().to("http://www.baidu.com");
// 通过查找元素的方法