ARC-MX/sgcc_electricity_new

内置的chromedriver无法识别CAPTCHA?

zjn9011 opened this issue · 1 comments

compose up --build的时候报错,log输出如下,似乎是chromedriver无法识别CAPTCHA?

sgcc_electricity  | 2024-09-13 12:11:52  [INFO    ] ---- The current repository version is v1.5.0, and the repository address is https://github.com/ARC-MX/sgcc_electricity_new.git
sgcc_electricity  | 2024-09-13 12:11:56  [INFO    ] ---- chromium-driver version is 120
sgcc_electricity  | 2024-09-13 12:11:56  [INFO    ] ---- enable_database_storage is true, we will store the data to the database.
sgcc_electricity  | 2024-09-13 12:11:56  [INFO    ] ---- The current logged-in user name is *********, the homeassistant address is http://localhost:8123/, and the program will be executed every day at 07:00.
sgcc_electricity  | 2024-09-13 12:11:56  [INFO    ] ---- Run job now! The next run will be at 07:00 and 19:00 every day
sgcc_electricity  | 2024-09-13 12:11:56  [INFO    ] ---- patching driver executable /usr/bin/chromedriver
sgcc_electricity  | 2024-09-13 12:12:13  [INFO    ] ---- Webdriver initialized.
sgcc_electricity  | 2024-09-13 12:12:22  [INFO    ] ---- Open LOGIN_URL:https://www.95598.cn/osgweb/login.
sgcc_electricity  | 2024-09-13 12:13:15  [INFO    ] ---- find_element 'user'.
sgcc_electricity  | 2024-09-13 12:13:28  [INFO    ] ---- input_elements username : **********.
sgcc_electricity  | 2024-09-13 12:13:30  [INFO    ] ---- input_elements password : **********.
sgcc_electricity  | 2024-09-13 12:13:31  [INFO    ] ---- Click the Agree option.
sgcc_electricity  | 2024-09-13 12:14:02  [INFO    ] ---- Click login button.
sgcc_electricity  | 2024-09-13 12:14:03  [INFO    ] ---- Get electricity canvas image successfully.
sgcc_electricity  | 2024-09-13 12:14:04  [INFO    ] ---- Image CaptCHA distance is 74.
sgcc_electricity  | 2024-09-13 12:14:58  [INFO    ] ---- Sliding CAPTCHA recognition failed and reloaded.
sgcc_electricity  | Traceback (most recent call last):
sgcc_electricity  |   File "/app/data_fetcher.py", line 244, in fetch
sgcc_electricity  |     return self._fetch()
sgcc_electricity  |   File "/app/data_fetcher.py", line 267, in _fetch
sgcc_electricity  |     if self._login(driver):
sgcc_electricity  |   File "/app/data_fetcher.py", line 331, in _login
sgcc_electricity  |     im_info = driver.execute_script(background_JS)
sgcc_electricity  |   File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 492, in execute_script
sgcc_electricity  |     return self.execute(command, {
sgcc_electricity  |   File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
sgcc_electricity  |     self.error_handler.check_response(response)
sgcc_electricity  |   File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
sgcc_electricity  |     raise exception_class(message, screen, stacktrace)
sgcc_electricity  | selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of null (reading 'childNodes')
sgcc_electricity  |   (Session info: chrome=120.0.6099.224)
sgcc_electricity  | Stacktrace:
sgcc_electricity  | #0 0x00555ca54850 <unknown>
sgcc_electricity  | #1 0x00555c75b3e0 <unknown>
sgcc_electricity  | #2 0x00555c760a1c <unknown>
sgcc_electricity  | #3 0x00555c762564 <unknown>
sgcc_electricity  | #4 0x00555c7e3000 <unknown>
sgcc_electricity  | #5 0x00555c7e2400 <unknown>
sgcc_electricity  | #6 0x00555c790904 <unknown>
sgcc_electricity  | #7 0x00555c791d80 <unknown>
sgcc_electricity  | #8 0x00555ca29618 <unknown>
sgcc_electricity  | #9 0x00555ca2c5f0 <unknown>
sgcc_electricity  | #10 0x00555ca2c1d8 <unknown>
sgcc_electricity  | #11 0x00555ca1c304 <unknown>
sgcc_electricity  | #12 0x00555ca2ccb0 <unknown>
sgcc_electricity  | #13 0x00555ca07858 <unknown>
sgcc_electricity  | #14 0x00555ca454c8 <unknown>
sgcc_electricity  | #15 0x00555ca456cc <unknown>
sgcc_electricity  | #16 0x00555ca53db4 <unknown>
sgcc_electricity  | #17 0x007fa6a8c648 start_thread
sgcc_electricity  | #18 0x007fa62c801c <unknown>
sgcc_electricity  |
sgcc_electricity  | 2024-09-13 12:16:08  [ERROR   ] ---- Webdriver quit abnormly, reason: Message: javascript error: Cannot read properties of null (reading 'childNodes')
sgcc_electricity  |   (Session info: chrome=120.0.6099.224)

me too
61b94716b439441f00313acb2d6d45d