For the life of me I can't figure out how to get a string\text element from this, it just returns:
<coroutine object Page.eval_on_selector at 0x106e145e0>
website_element =page.locator("//a[contains(@aria-label, 'Website')]") print (website_element) if website_element: #abc = website_element.text_content() #abc = website_element.get_attribute("value") abc = page.eval_on_selector(website_element,'(element) => element.textContent')
print(str(abc))
This thread is trying to answer question "How to get a string/text element using 'page.eval_on_selector' in Python Playwright instead of a coroutine object?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].