0

I encouter a issue while trying to get some elements by xpath using selenium in python.

I work on webpages similar to this one : https://warframe.market/items/mirage_prime_set

I'm trying to get the item price however selenium doesn't find the element I'm looking for but I can find it using xpath on my browser.

picture : xpath result on browser (in red are the elements I'm looking for)

There is my code :

price_list = driver.find_elements_by_xpath( '//div[@class="orders-row__element order__price sell_color"]/span[1]' )
print( len(price_list) ) #there is my issue, price_list is empty

but it raise a NotSuchElementExeption, using an abolute path instead of a relative one do not raise such exeption but I wonder why the relative path dos not work ?

I hope I'm being clear enought (if not just tell me) and I apologize for my English.

If someone can help me it would be great, thank you.

4rklog
  • 1
  • 2
  • Welcome to stackoverflow. Post the code segment where you tried the above. Also post the error you got. – Kabilesh Apr 18 '19 at 10:14
  • Thanks ! I edited my post, the issue is a NotSuchElementExeption witch seem strange because this xpath line is functionnal while trying directly on the browser, and the above code is working (I have other xpath queries above and they don't raise exeption so the problem is on this line) I don't think it is required to post it – 4rklog Apr 18 '19 at 10:35
  • Try adding Waits like in https://stackoverflow.com/questions/19536954/what-is-the-best-way-to-avoid-nosuchelementexception-in-selenium – Kabilesh Apr 18 '19 at 10:37

0 Answers0