0

I'm trying to get string:

Liquidity (Including Fees)

from line

<div class="sc-bdVaJa KpMoH css-1ecm0so">Liquidity (Including Fees)</div>

I've tried these below none of them gave me the string that I want:

usdbaslik = driver.find_element_by_css_selector("[class='sc-bdVaJa KpMoH css-1ecm0so']")
print(usdbaslik.text,":---text")
print(usdbaslik.tag_name,":---tag_name")
print(usdbaslik.id,":---id")
print(usdbaslik.size,":---size")
print(usdbaslik.rect,":---rect")
print(usdbaslik.location,":---location")
print(usdbaslik.location_once_scrolled_into_view,":---location_once_scrolled_into_view")
print(usdbaslik.parent,":---parent")
print(usdbaslik.screenshot_as_png,":--screenshot_as_png")
print(usdbaslik.screenshot_as_base64,":--screenshot_as_base64")
print(usdbaslik.__class__,":--__class__")

What am I doing wrong? Thanks in advance.

3
  • Can you share URL so that we can try? Commented May 8, 2021 at 9:19
  • 1
    driver.find_element_by_css_selector(".sc-bdVaJa.KpMoH.css-1ecm0so") Commented May 8, 2021 at 9:19
  • Sure info.pangolin.exchange/#/account/… Thank You. Commented May 8, 2021 at 10:53

1 Answer 1

1

There is (at least) one other element with that class on the page, so it's not a unique selector. The closest thing I was able to find to a unique selector looking at the page would be

usdbaslik = driver.find_elements_by_xpath('//div[@class="sc-VigVT fKQdIL"]//div[@class="sc-bdVaJa KpMoH css-1ecm0so"]')[0])

Then you can get the text from the label with

print(usdbaslik.get_attribute('innerText'))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.