I've been trying for hours to find the correct link to use in selenium for the HP value of this game.
To check yourself, I'll provide a user & password as belowed:
Website : https://s3-en.bitefight.gameforge.com/user/login
Username: testaccount111
Password: python123
I've tried health = driver.find_elements_by_xpath("//div[2]/div/div[1]/text()[5]")
but it gives errors.
use below xpath to locate you element ( marked in image )
but selenium doesn't allow you to locate an element using text node. alternative way is you can use javascript executor to evaluate the xpath.
I have below code reference in Java. please change as per python
OR
As per the website
https://s3-en.bitefight.gameforge.com/user/login
to extract the text from Health element i.e. 8.460 / 21.500 you need to induce WebDriverWait for the desired element to be visible and you can use the following solution:Code Block:
Console Output:
@NarendraR has good answer, in python the code to get result as
21500
isand for another method