2013-12-22 101 views
-2

我想用selenium来抓取由JavaScript函数生成的一些Web信息。但我不想在我的屏幕上显示浏览器上的自动化工作。我怎样才能做到这一点?如何使用硒而不在屏幕上显示浏览器?

+2

很多答案在那里回答这个问题。 http://sqa.stackexchange.com/questions/2609/running-webdriver-without-opening-actual-browser-window http://stackoverflow.com/questions/1418082/is-it-possible-to-hide-the -browser-in-selenium-rc http://stackoverflow.com/questions/16180428/can-selenium-webdriver-open-browser-windows-silently-in-background – sircapsalot

回答

1

它也取决于您使用的操作系统。对于基于Linux的系统,您可以使用Xvfb。对于Windows,您可以选择使用Selenium提供的HTMLUnitDriver,也可以使用PhantomJS作为浏览器。使用最新版本的selenium webdriver,phantomjs绑定也可用。

相关问题