2013-12-22 100 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綁定也可用。

相關問題