当我使用selenium获取页面源时,它将通过系统Firefox使用selenium服务器。当服务器没有 Firefox 时,如何在服务器上加载我的代码?
Web-driver driver = new Firefox-driver();
driver.navigate().to(url);
String st = driver.getPageSource();
driver.close();
最佳答案
如果selenium仅用于抓取/爬行,则可以选择Headless firefox 点击链接 http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
关于java - 使用selenium获取页面源代码,如何在没有firefox的服务器上使用我的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23783766/