I am writing an application which will launch the webpage in a webview. I can retreive the html content from the webpage.To increase the loading speed, I am trying to remove the ads from the webpage. I have researched alot, how to find the ads from a webpage but failed. Helping me would be appreciable
Share
You can look for anything that points to a advertiser webserver and remove it via either Regex or via DOM manipulation (and you should do that via injecting Javascript to your webpage, will be much easier). That’s how some Ad Removal tools work.
But make sure to respect the website host revenue stream. Some guys live with ads to provide content. 😉
[EDIT] a jQuery code sample to remove links and imgs pointing to google servers. You need to update with the ad servers you’re targetting:
You can run it in ign homepage, it’ll remove some of the ads.