Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restricting Selenium/Webdriver/HtmlUnit to a certain domain

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,

like image 732
Ali Salehi Avatar asked Jun 24 '11 13:06

Ali Salehi


1 Answers

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.

like image 149
yura Avatar answered Jan 04 '23 07:01

yura