You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
browser = await uc.start()
page = await browser.get('url')
url2 = 'example.com'
#For special reasons, you need to use evaluate window.open to bypass Cloudflare
await page.evaluate(f'''window.open("{url2}", "_blank"); ''')
await page.close()
print(str(len(browser.tabs)))
#output len 2
page=browser.tabs[len(self.browser.tabs)-1]
In fact, the effect I want is to make the page become the last page of the browser when closing the current page.
But this doesn’t seem right, any suggestions?
The text was updated successfully, but these errors were encountered:
browser = await uc.start()
page = await browser.get('url')
url2 = 'example.com'
#For special reasons, you need to use evaluate window.open to bypass Cloudflare
await page.evaluate(f'''window.open("{url2}", "_blank"); ''')
await page.close()
print(str(len(browser.tabs)))
#output len 2
page=browser.tabs[len(self.browser.tabs)-1]
In fact, the effect I want is to make the page become the last page of the browser when closing the current page.
But this doesn’t seem right, any suggestions?
The text was updated successfully, but these errors were encountered: