'Selenium : googlemap markers dont appear in my xpath elements?

I would like to scrape some informations from a googlemap applet.

The page is here : http://www.annuaire-des-psychologues.fr/psychologue/limousin/ You can click on the map on items to get informations displayed over the map.

When i try to inspect with developers tools, i dont see anything...ie: i dont see the markers elements in my developer tool. If i click a marker, some new elements appear in my developer tool but i would like to automate the clicks on the marker with selenium.

I guess it's javascript or something like that. How can i manage to retrieve the elements xpaths? If it is javascript, do you have documentation on how to retrieve it in selenium and how to spot the source javascript used in the page im trying to scrape?

Thank you.



Solution 1:[1]

What element are you trying to grab? you can use xpath for this

element = driver.find_element(by=By.XPATH, value="(//*[src()='ur_element_here'])")

when you try to inspect and click a certain location on the map it'll link you to

<script type="text/javascript" charset="UTF-8" src="ur_element_here"></script>

you are basically telling it to search via the src header and find whatever text comes after it

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1