Skip to content
Advertisement

Google Earth scraping using python selenium

I want to create a web scraper for earth.google.com/web. Whenever the user clicks while holding shift button, the script will print the coordinates which are displayed at the bottom right corner of the google earth web page.

I am using selenium with chromedriver but it cannot find the coordinates web element. I have tried css selector, xpath, full x-path, find by id. Nothing worked.

Here is my code:

JavaScript

Advertisement

Answer

The element is inside shadow root element you need to use query selector to identify the element.Induce javascript executor.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement