I often see puppeterr memo
result_page_future = asyncio.get_event_loop().create_future()
browser.once(
| 'targetcreated',
| lambda target: result_page_future.set_result(target)
)
_link = await page.J('a.hoge')
await _link.click()
newtab_page = await (await result_page_future).page()
await newtab_page.close()
Recommended Posts