Java 操作chrome

1、下载 chromedriver.exe

2、添加依赖

<dependency>
	<groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
	<version>2.44.0</version>
</dependency>

3、

System.setProperty("webdriver.chrome.driver",
				"src/test/java/chromedriver.exe");
		ChromeDriver driver = new ChromeDriver();
		
		driver.get("http://www.baidu.com/ ");

		// Find the text input element by its name

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










你可能感兴趣的:(Java 操作chrome)