V
V
vaflya2018-07-25 21:21:28
Python
vaflya, 2018-07-25 21:21:28

Selenium XPath - how to select li element from list?

I'm trying to get the first search result on the yandex.ru page

driver.find_elements_by_xpath('//ul[@class="serp-list"]/li[@class="serp-item"]')

but can't find anything
driver.find_elements_by_xpath('//ul[@class="serp-list"]')

can't find list
driver.find_elements_by_xpath('//*[@class="serp-list"]')

so finds 1 element
why so?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question