Код: Выделить всё
try:
tab = await browser.get("https://www.hm.com")
await asyncio.sleep(3)
sign_up_button = await tab.find("//a[@class='styles__ButtonRoot-sc-1ldytso-0 bzOPhu']")
print(f"Sign Up Button: {sign_up_button}") # this prints the entire html for the button
# Open the sign-up URL in a new tab
sign_up_url = await sign_up_button.get_attribute("href") # most likely wrong
print(f"Sign Up URL: {sign_up_url}") # does not print
# Open the sign-up URL in a new tab
signup_tab = await browser.get(sign_up_url)
await asyncio.sleep(5)
except Exception as e:
print(f"Error during signup: {e}")
Подробнее здесь: https://stackoverflow.com/questions/790 ... b-nodriver