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

Doesn't work on Chrome #91

Closed
LipeTadeu opened this issue Mar 26, 2024 · 7 comments
Closed

Doesn't work on Chrome #91

LipeTadeu opened this issue Mar 26, 2024 · 7 comments

Comments

@LipeTadeu
Copy link

Hi, how are you?
Do you know why it doesn't run in Chrome when we use headless=False?

example:

with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False)

He opens the browser but does not resolve recaptcha and does not even click on recaptcha.

That doesn't work either.

with sync_playwright() as playwright:
browser = playwright.chromium.launch(channel='chrome',headless=False)

only works in Firefox.

Thank.

@Xewdy444
Copy link
Owner

Xewdy444 commented Mar 27, 2024

What version of Playwright are you using and what website are you using? I tried an example with Chromium and it solved it with no issues:

from playwright.sync_api import sync_playwright
from playwright_recaptcha import recaptchav2

with sync_playwright() as playwright:
    browser = playwright.chromium.launch(headless=False)
    page = browser.new_page()
    page.goto("https://www.google.com/recaptcha/api2/demo")

    with recaptchav2.SyncSolver(page) as solver:
        token = solver.solve_recaptcha(wait=True)
        print(token)

@LipeTadeu
Copy link
Author

Hello!
All is well?

Here it doesn't really run using Chrome, it only runs if headless=True.

I'm using version playwright==1.33.0

Which one do you run on your machine?

@Xewdy444
Copy link
Owner

Try updating Playwright to the latest version with the command: pip install -U playwright and see if this fixes the issue.

@LipeTadeu
Copy link
Author

Hello!
All is well?
Find out what it was, the error was language, I switched the browser to English and it ran perfectly.
Thank you very much.

It looked like this:

from playwright.sync_api import sync_playwright
from playwright_recaptcha import recaptchav2

with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False)
context = browser.new_context(locale="en-US")
page = context.new_page()
page.goto("https://www.google.com/recaptcha/api2/demo")

with recaptchav2.SyncSolver(page) as solver:
    token = solver.solve_recaptcha(wait=True)
    print(token)

@Xewdy444
Copy link
Owner

Glad to see that you fixed the issue. This library currently supports English and Russian reCAPTCHA, however I could add support for your language as well if you don't mind telling me what it is.

@LipeTadeu
Copy link
Author

Hello!
Wow, that's great, I don't mind.
I'm Brazilian, Brazilian Portuguese.
I would appreciate it if you could give me your email, I would like to make you a development proposal.

@Xewdy444
Copy link
Owner

Yea sure, my contact information is on my GitHub profile.

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

2 participants