Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nodriver] Why does the number of browser.tabs remain unchanged after "Page" close? #1864

Open
mashien0201 opened this issue May 4, 2024 · 0 comments

Comments

@mashien0201
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant