Restricting Selenium/Webdriver/HtmlUnit to a certain domain

江枫思渺然 提交于 2019-12-04 22:44:54

问题


While using selenium/webdriver for web scraping, I realized the target site has google analytics script running. Is there a way to restrict selenium/webdriver/htmlunit to avoid certain urls/domains ?

Thanks,


回答1:


I think it is impossible becouse Selenium is actually adapter for several implementation. So he can't deny to load some scripts to firefox or chrome. Perhaps you can check driver api(firefox profile, htmlunit configuration file) to accomplish this.



来源:https://stackoverflow.com/questions/6468624/restricting-selenium-webdriver-htmlunit-to-a-certain-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!