Search code examples
pythonselenium-webdriveryandex-maps

Find by class name can not found elements


https://parselsorgu.tkgm.gov.tr/

in this webpage, i am trying to find elements in satelite yandex view, but selenium cannot find anything in this section. how can i find elements in this satelite yandex view. if i press inspect, i can see the codes, but can not reach them..

sinir=sinir.find_elements_by_class_name('leaflet-zoom-animated')

gets, error. it can get from drop box menus, but cannot get satelite yandex view part


Solution

  • You can find it as;

    //*[@id="map-canvas"]/div[@class='leaflet-pane leaflet-map-pane']/div[@class='leaflet-pane leaflet-overlay-pane']//*[name()='svg']//*[name()='g']
    

    All you need to use is the name() tag.

    I found this element by selecting random area from the left bar.

    element is not visible by class name, you can use name() = 'svg'

    I think this will help you to understand..