richim1 2 Posted March 5, 2013 Report Share Posted March 5, 2013 Been working with web with a ton of ads (google ads, dll), very annoying & make bot load slow.tried to disable JS...and yes ads disappear, but the bot not working properly, because the bot uses JS itself.Do you know how we can block ads without disable JS entirely?Like Adblockplus addons in firefox i mean. Quote Link to post Share on other sites
luis carlos 94 Posted March 5, 2013 Report Share Posted March 5, 2013 Block them using your hosts file C:\Windows\System32\drivers\etc\hosts. It can take a while but worth it. 1 Quote Link to post Share on other sites
richim1 2 Posted March 5, 2013 Author Report Share Posted March 5, 2013 Block them using your hosts file C:\Windows\System32\drivers\etc\hosts. It can take a while but worth it.Ok, thanks mate...works perfectly. But still searching the other way in bot itself...because i'll also send to my client. Quote Link to post Share on other sites
steelersfan 38 Posted August 5, 2016 Report Share Posted August 5, 2016 I had this question as well, so instead of making a new thread, I will just ask: How can we block ads for client side bots? Just like adblock plus firefox extension. Something aside from having to buy xbrowser and use firefox itself, or disable java. Quote Link to post Share on other sites
deliter 203 Posted August 5, 2016 Report Share Posted August 5, 2016 easiest way assuming you are making a bot for one particular platform their ads will probably be the same HTML on each page,check this out,it deletes the google ads from this page,though this probably wont help performance,it will at least look cleaner for the customer This is slightly hacky basically when navigating to a new page,turn on headless browser,leave page load,remove the adds and then display the page to the customer ive noticed from testing that sometime Ubot displays elements that were previously viewable before I turn headless On,will be their when I turn it off Example,,run this,then,press refresh on browser,then run the script without the javscript and the ads should be their,though not live,literally the same ad that was present before you ran the script,if you scroll they disappear,seems to be stored in memory or something,so I added a tiny scroll which a user wouldn't notice set headless browser("On") allow images("Yes") allow javascript("Yes") allow css("Yes") navigate("http://www.speedtest.net/","Wait") wait for browser event("Everything Loaded","") change attribute(<id=w"google_ads_iframe_*">,"innerhtml","") set headless browser("Off") run javascript("document.body.scrollTop = document.body.scrollTop+2") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.