将Selenium/Webdriver/HtmlUnit限制到特定域

将Selenium/Webdriver/HtmlUnit限制到特定域,selenium,webdriver,htmlunit,Selenium,Webdriver,Htmlunit,在使用selenium/webdriver进行web抓取时,我意识到目标站点正在运行google analytics脚本。有没有办法限制selenium/webdriver/htmlunit以避免某些URL/域 谢谢,我认为这是不可能的,因为Selenium实际上是几个实现的适配器。所以他不能拒绝将一些脚本加载到firefox或chrome。也许您可以通过检查驱动程序api(firefox配置文件、htmlunit配置文件)来实现这一点

在使用selenium/webdriver进行web抓取时,我意识到目标站点正在运行google analytics脚本。有没有办法限制selenium/webdriver/htmlunit以避免某些URL/域


谢谢,

我认为这是不可能的,因为Selenium实际上是几个实现的适配器。所以他不能拒绝将一些脚本加载到firefox或chrome。也许您可以通过检查驱动程序api(firefox配置文件、htmlunit配置文件)来实现这一点