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

2023/11/27 17:55:42 ERROR It is not possible to pass verification #46

Closed
Free-Max367 opened this issue Nov 27, 2023 · 6 comments
Closed

Comments

@Free-Max367
Copy link

Free-Max367 commented Nov 27, 2023

I successfully used your library https://github.com/ugorsahin/ChatGPT_Automation on September 6, 2023. I had installed on my Windows 10 PC:

  • Google Chrome Version 116.0.5845.188 (Official Build) (64 bits)
  • Stable version 116.0.5845.96 of chromedriver.exe installed in C:\Program Files\Google\Chrome\Application
  • Selenium version 4.9.0

My Google Chrome version has been updated to 119.0.6045.160 (Official Build) (64 bits), and I've changed chromedriver.exe stable version to 119.0.6045.105 (even tried 119.0.6045.159).
I'm installing https://github.com/ugorsahin/TalkingHeads with 'pip install talkingheads', which forces the installation of Selenium version 4.15.2:

Installing collected packages: selenium, talkingheads
Attempting uninstall: selenium
Found existing installation: selenium 4.9.0
Uninstalling selenium-4.9.0:
Successfully uninstalled selenium-4.9.0
Successfully installed selenium-4.15.2 talkingheads-0.2.1

However, the Python instruction chathead = ChatGPTClient(username=username, password=password, driver_version=119, verbose=True) no longer works:

2023/11/27 17:55:16 WARNING The usage of username and password parameters are deprecated and will be removed in near feature.Please adjust your environment variables to pass username and password.
2023/11/27 17:55:16 INFO Verbose mode active
2023/11/27 17:55:16 INFO Loading undetected Chrome
2023/11/27 17:55:29 INFO patching driver executable C:\Users\Free_Max367\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe
2023/11/27 17:55:30 INFO Loaded Undetected chrome
2023/11/27 17:55:30 INFO Opening ChatGPT
2023/11/27 17:55:30 INFO Preload behaviour is not implemented, that may be normal if verification is not necessary
2023/11/27 17:55:31 INFO Verification button is not present or clickable
2023/11/27 17:55:32 INFO Clicked verification button
2023/11/27 17:55:33 INFO Clicked verification button
2023/11/27 17:55:34 INFO Clicked verification button
2023/11/27 17:55:35 INFO Clicked verification button
2023/11/27 17:55:36 INFO Clicked verification button
2023/11/27 17:55:37 INFO Clicked verification button
2023/11/27 17:55:39 INFO Clicked verification button
2023/11/27 17:55:40 INFO Clicked verification button
2023/11/27 17:55:41 INFO Clicked verification button
2023/11/27 17:55:42 ERROR It is not possible to pass verification
2023/11/27 17:55:42 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 1
2023/11/27 17:55:43 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 2
2023/11/27 17:55:44 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 3
2023/11/27 17:55:45 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 4
2023/11/27 17:55:46 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 5
2023/11/27 17:55:47 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 6
2023/11/27 17:55:48 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 7
2023/11/27 17:55:49 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 8
2023/11/27 17:55:50 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 9
2023/11/27 17:55:51 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 10
2023/11/27 17:55:52 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 11
2023/11/27 17:55:53 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 12
2023/11/27 17:55:54 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 13
2023/11/27 17:55:55 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 14
2023/11/27 17:55:56 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 15
2023/11/27 17:55:57 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 16
2023/11/27 17:55:58 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 17
2023/11/27 17:55:59 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 18
2023/11/27 17:56:00 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 19
2023/11/27 17:56:01 INFO Element //button[//div[text()="Log in"]] is not present, attempt: 20
Traceback (most recent call last):
File ~\AppData\Local\anaconda3\envs\report\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File c:\users\Free_Max367\onedrive\projets\brand\2023\s2ts\whisper_python\data4_anomaly_detection\compte_rendu (1).py:196
chathead = ChatGPTClient(username = username,
File ~\AppData\Local\anaconda3\envs\report\lib\site-packages\talkingheads\model_library\chatgpt.py:47 in init
super().init(
File ~\AppData\Local\anaconda3\envs\report\lib\site-packages\talkingheads\model_library\base_browser.py:104 in init
self.login(username, password)
File ~\AppData\Local\anaconda3\envs\report\lib\site-packages\talkingheads\model_library\chatgpt.py:106 in login
login_button.click()
AttributeError: 'list' object has no attribute 'click'

Have you ever encountered this type of malfunction?
Could you advise me on the origin of the problem?
Thanks in advance.

@ugorsahin
Copy link
Owner

Hi,

It seems that Cloudflare is blocking you because they believe you are a bot. This occurs when particular information of your browser or network connection is an identifier for their bot detection. Unfortunately, this repository does not aim to pass Cloudflare's advanced bot protection. From my previous experience, IP is an important marker for them to decide whether a connection is bot or not.

If you would like to find a solution, you can search the internet for the evading cloudflare's bot detection.

@Free-Max367
Copy link
Author

Thank you for this very prompt response @ugorsahin
And thank you for these two valuable tips to continue my development.

@Free-Max367
Copy link
Author

Free-Max367 commented Nov 28, 2023

Hello @ugorsahin ,

After some research, I found the solution and would like to share it with you.
The issue is not related to my IP being detected as a bot by CloudFlare.
The problem stems from the Google Chrome update to version 119, which doesn't seem to be handled correctly by 'undetected-chromedriver'.

My modifications:

  • I installed version 116.0.5845.96 of 'chrome-for-testing' and its associated chromedriver.exe in a directory.
    https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chrome-win64.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip

  • In your 'base_browser.py' file, I added the argument browser_executable_path pointing to the executable of Chrome in version 116.0.5845.96.
    self.browser = uc.Chrome( user_data_dir=user_data_dir, driver_executable_path=driver_executable_path, browser_executable_path= browser_executable_path, options=options, headless=headless, version_main=detect_chrome_version(driver_version), log_level=10, )

  • In your 'ChatGPTClient' function, I added the argument driver_executable_path pointing to chromedriver.exe stable version 116.0.5845.96.
    chathead = ChatGPTClient(username = username, password = password, driver_executable_path = driver_executable_path, driver_version = 116, verbose=True)

Here is the result of running the ChatGPTClient command.

2023/11/28 23:04:42 WARNING The usage of username and password parameters are deprecated and will be removed in near feature.Please adjust your environment variables to pass username and password.
2023/11/28 23:04:42 INFO Verbose mode active
2023/11/28 23:04:42 INFO Loading undetected Chrome
2023/11/28 23:04:46 INFO Loaded Undetected chrome
2023/11/28 23:04:46 INFO Opening ChatGPT
2023/11/28 23:04:46 INFO Preload behaviour is not implemented, that may be normal if verification is not necessary
2023/11/28 23:04:47 INFO Element //button[//div[text()="Log in"]] has found
2023/11/28 23:04:47 INFO Clicked login button
2023/11/28 23:04:49 INFO Element username has found
2023/11/28 23:04:49 INFO Filled email box
2023/11/28 23:04:49 INFO Element //button[text()="Continue"] has found
2023/11/28 23:04:51 INFO Clicked continue button
2023/11/28 23:04:51 INFO Element password has found
2023/11/28 23:04:51 INFO Filled password box
2023/11/28 23:04:52 INFO Logged in
2023/11/28 23:04:57 INFO Info screen skipped
2023/11/28 23:04:57 INFO ChatGPT is ready to interact

The problem is now resolved.
I suggest adding the browser_executable_path argument to your 'ChatGPTClient' function so that users can choose the version of Google Chrome.
I wanted to conclude by thanking you for this outstanding development.

@Free-Max367
Copy link
Author

Hello @ugorsahin,

I wanted to know if you had seen my proposal and what you think about it: I suggest adding the browser_executable_path argument to your 'ChatGPTClient' function so that users can choose the version of Google Chrome.

@ugorsahin
Copy link
Owner

Hey,

With the recent 0.3.0 version you can pass the parameters to uc.Chrome by using uc_params argument. I hope that solves your problem.

@Free-Max367
Copy link
Author

Hello @ugorsahin,

Thank you for integrating this uc_params argument into uc.Chrome.
This version 0.3.0 works perfectly.
Even the issue [Bug] Only return ChatGPT #45 has disappeared.
This update definitively closes this problem #46.

chathead = ChatGPTClient(username = username, password = password, driver_version = 116, verbose=True, uc_params = {'browser_executable_path' : browser_executable_path, 'driver_executable_path' : driver_executable_path})

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