to implement click in arsenic library
-
I'm moving from selenium to arsenic, and there's a click error, if it worked in selenium, then in arsenic, I understand the click works differently, and, accordingly, a mistake:
AttributeError: 'coroutine' object has no attribute 'click'.
How do you put the click in arsenic?
import asyncio from arsenic import *
async def flashscore():
service = services.Chromedriver(binary="./chromedriver.exe")
browser = browsers.Chrome()
async with get_session(service, browser) as session:
await session.get("https://www.flashscore.com")
accept = session.wait_for_element(0.1, "#onetrust-accept-btn-handler").click()
await asyncio.sleep(5)def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(flashscore())if name == 'main':
main()
-
Add:
accept = await session.wait_for_element(0.1, "#onetrust-accept-btn-handler") await accept.click()