Extract google Ads from Website Using Java with Selenium Library

I developing the application to extract google ads from user given URL using Java with selenium. Am only able to extract google ads using HTML tag. But it change frequently. There is any other solution or any API’s available for this?

1 thought on “Extract google Ads from Website Using Java with Selenium Library”

  1. for web scraping , site owners can change the DOM anytime and code is likely to fail.

    The best you can do is write a test that runs periodically and verifies the health of all your DOM dependencies and then you can raise an alert mail when there is a change.

    There is also an another approach we took (it was for gmail though), this probably, won’t apply for your use case, we assumed that the logged in user will always remain constant, and we tried to find HTML/DOM selectors for our constant logged in user mail and then we were able to write some logic to dynamically find DOM/CSS selectors for our dependent elements, this helped to mitigate the problem, but, it is hard to write a full-proof solution for such use cases

    Reply

Leave a Comment