1
我的代碼有問題 - 請參閱下文。有人能告訴我什麼是錯的嗎?它不會連接,但一切都是正確的。如何使用java將phantomjs連接到硒
import java.io.File;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.testng.annotations.Test;
public class Main {
@Test
public static void main(String[] args){
File src = new File("phan//bin//phantomjs");
// System.out.println("test:" + File);
System.setProperty("phantomjs.binary.path",src.getAbsolutePath());
WebDriver driver = new PhantomJSDriver();
driver.get("http://facebook.com");
System.out.println(driver.getTitle());
}
}