Skip to content
Advertisement

pycharm python selenium scraper apparently not printing correct value

I new to python, selenium, pycharm and such.

I’m trying to print the value of a on a website ( at the moment of writing this the value is 6320 ).The code is not giving errors but it’s printing nothing.

As you can see in the screenshot, when i’m debugging and hovering over the variable, it’s displaying 6320, which is the value i’m looking for.

What am I doing wrong?

JavaScript

enter image description here

Thanks a lot for your help!

Advertisement

Answer

You need wait until .visibility_of_element_located and use this xpath: //td[contains(., "Total*")]//span[last()], although your xpath also works, but it is an absolute xpath that is vulnerable to change.

JavaScript

Following import :

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