phantomjsDriver的初始化

public static void main(String[] args)
{
    File file=new File("src/main/resources/drivers");
    System.setProperty("phantomjs.binary.path",file+"/phantomjs.exe");
    WebDriver driver=new PhantomJSDriver();
    driver.get("http://www.baidu.com");
    System.out.println(driver.getPageSource());

}

 

 



 

 

posted @ 2016-12-09 22:17  xxyBlogs  阅读(4212)  评论(0编辑  收藏  举报