What I need is a way to get out of async with (line 2) if page.click (line 4) doesn't find the element, I tried with break but it didn't work, here's the code:
try:
async with page.expect_download(timeout=120000) as download_info:
try:
await page.click(First_Row_Download, timeout=3000)
except:
break
Download = await download_info.value
await Download.save_as(Download.suggested_filename)
Download_Finished = True
break
except:
await page.wait_for_timeout(Wait_Time) # 3 Minutos
await page.click(Button_Refresh)