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

[BUG] #58

Closed
alenkimov opened this issue Feb 19, 2024 · 4 comments
Closed

[BUG] #58

alenkimov opened this issue Feb 19, 2024 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@alenkimov
Copy link

alenkimov commented Feb 19, 2024

Describe the bug
Google pages don't load with proxies. And if I open a new tab manually from the same browser, the page will load normally. The problem is clearly not in my proxies.

Code Sample

import asyncio
import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser(
        proxy="user:pass@ip:port",
    )
    page = await browser.new_page()
    await page.goto("https://www.myip.com")  # loads

    page = await browser.new_page()
    await page.goto("https://accounts.google.com")  # fails to load!!!
    await page.wait_for_timeout(5000)
    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main())

Screenshots
image

Desktop:

  • Windows 11
@alenkimov alenkimov added bug Something isn't working help wanted Extra attention is needed labels Feb 19, 2024
@alenkimov
Copy link
Author

pycharm64_kxCHnLNpP5

@skhrlx
Copy link

skhrlx commented Feb 20, 2024

import asyncio
import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser(
        proxy="user:pass@ip:port",
    )
    page = await browser.new_page()
    await page.goto("https://www.myip.com")
    await page.goto("https://accounts.google.com") 
    await page.wait_for_timeout(5000)
    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main())

When trying "new_page" he starts a newer browser, and botright is not thread safe, to go into a new URL, just use page.goto

https://github.com/Vinyzu/Botright/blob/main/docs/index.rst

Read the docs and this issue if you are planning to use threading in some way: microsoft/playwright-python#623

@Vinyzu
Copy link
Owner

Vinyzu commented Feb 20, 2024

I dont think this issue has anything to do with the thread(un)safeness.
Also, this behaviour works in Playwright so it is exptected to work in botright.
Im investingating.

@Vinyzu
Copy link
Owner

Vinyzu commented Feb 20, 2024

Using a Good Proxy or an Localhost Proxy, i cannot replicate this bevahiour.
Its probably a low ip quality which gets you flagged by google, so you cant even access their login site.
Ive run a Quality Check on the IP shown in the Video:
IP Quality

So my best guess is that Google just flags your IP and just doesnt send you a response back for the site html request.
I dont see any issue in botrights, or playwrights code.

@Vinyzu Vinyzu closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants