运行报错
Closed this issue · 2 comments
运行的时候出现这个,
香港 linux vps ubuntu 22 中运行的,然后出现了这种错误,请求支持
提示 user 找不到,是不是我 vps 中要配置 chrome 还是什么呀
sgcc_electricity | 2024-08-28 23:47:12 [INFO ] ---- Open LOGIN_URL:https://www.95598.cn/osgweb/login.
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 307, in _login
sgcc_electricity | driver.find_element(By.CLASS_NAME, "user").click()
sgcc_electricity | File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
sgcc_electricity | return self.execute(Command.FIND_ELEMENT, {
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.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".user"}
sgcc_electricity | (Session info: chrome=120.0.6099.224)
sgcc_electricity | Stacktrace:
sgcc_electricity | #0 0x562165123233
sgcc_electricity | #1 0x562164ded0fe
sgcc_electricity | #2 0x562164e36ba6
sgcc_electricity | #3 0x562164e36cc1
sgcc_electricity | #4 0x562164e84204
sgcc_electricity | #5 0x562164e6444d
sgcc_electricity | #6 0x562164e81680
sgcc_electricity | #7 0x562164e641a3
sgcc_electricity | #8 0x562164e2913e
sgcc_electricity | #9 0x562164e2a712
sgcc_electricity | #10 0x5621650f8534
sgcc_electricity | #11 0x5621650fb759
sgcc_electricity | #12 0x5621650fb238
sgcc_electricity | #13 0x5621650fbc05
sgcc_electricity | #14 0x5621650eaabf
sgcc_electricity | #15 0x5621650fbf8e
sgcc_electricity | #16 0x5621650d4c86
sgcc_electricity | #17 0x5621651143e5
sgcc_electricity | #18 0x5621651145cb
sgcc_electricity | #19 0x5621651227bf
sgcc_electricity | #20 0x7f2a18bc6ea7 start_thread
sgcc_electricity |
sgcc_electricity | 2024-08-28 23:48:22 [ERROR ] ---- Webdriver quit abnormly, reason: Message: no such element: Unable to locate element: {"method":"css selector","selector":".user"}
sgcc_electricity | (Session info: chrome=120.0.6099.224)
sgcc_electricity | Stacktrace:
sgcc_electricity | #0 0x562165123233
sgcc_electricity | #1 0x562164ded0fe
sgcc_electricity | #2 0x562164e36ba6
sgcc_electricity | #3 0x562164e36cc1
sgcc_electricity | #4 0x562164e84204
sgcc_electricity | #5 0x562164e6444d
sgcc_electricity | #6 0x562164e81680
sgcc_electricity | #7 0x562164e641a3
sgcc_electricity | #8 0x562164e2913e
sgcc_electricity | #9 0x562164e2a712
sgcc_electricity | #10 0x5621650f8534
sgcc_electricity | #11 0x5621650fb759
sgcc_electricity | #12 0x5621650fb238
sgcc_electricity | #13 0x5621650fbc05
sgcc_electricity | #14 0x5621650eaabf
sgcc_electricity | #15 0x5621650fbf8e
sgcc_electricity | #16 0x5621650d4c86
sgcc_electricity | #17 0x5621651143e5
sgcc_electricity | #18 0x5621651145cb
sgcc_electricity | #19 0x5621651227bf
sgcc_electricity | #20 0x7f2a18bc6ea7 start_thread
sgcc_electricity | . 5 retry times left.
sgcc_electricity | 2024-08-28 23:48:22 [ERROR ] ---- state-refresh task failed, reason is cannot unpack non-iterable NoneType object
sgcc_electricity | Traceback (most recent call last):
sgcc_electricity | File "/app/main.py", line 61, in run_task
sgcc_electricity | user_id_list, balance_list, last_daily_date_list, last_daily_usage_list, yearly_charge_list, yearly_usage_list, month_list, month_usage_list, month_charge_list = data_fetcher.fetch()
sgcc_electricity | TypeError: cannot unpack non-iterable NoneType object
香港IP访问大陆的国网账号你试过吗?
…
---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年08月28日 23:53 | | 营养 | @.> | | 抄送至| @.> | | 主题 | [ARC-MX/sgcc_electricity_new] 运行报错 (Issue #44 ) | 运行的时候出现这个,我是在香港的linux vps中运行的,然后出现了这种错误,请求支持提示用户找不到,是不是我vps中要配置chrome还是什么呀2024-08-28 23:47:12 [INFO] ---- 打开 LOGIN_URL: https://www.95598.cn/osgweb/login。 sgcc_电力 |回溯(最近一次调用最后一次):sgcc_electricity |文件“/app/data_fetcher.py”,第 244 行,在获取 sgcc_electricity | 返回 self._fetch() sgcc_electricity | 文件“/app/data_fetcher.py”,第 267 行,在 _fetch sgcc_electricity | 如果 self._login(driver): sgcc_electricity | 文件“/app/data_fetcher.py”,第 307 行,在 _login sgcc_electricity | driver.find_element(By.CLASS_NAME, "user").click() sgcc_electricity | 文件“/usr/local/lib/python3.9/ site-packages/selenium/webdriver/remote/webdriver.py”,第 856 行,在 find_element sgcc_electricity |返回 self.execute(Command.FIND_ELEMENT, { sgcc_electricity | 文件“/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py”, 第 429 行, 执行 sgcc_electricity | self.error_handler .check_response(response) sgcc_electricity | 文件“/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py”,第 243 行,在 check_response sgcc_electricity | 引发 exception_class(message、screen、stacktrace ) sgcc_electricity | selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法找到元素:{“method”:“css selector”,“selector”:“。user”} sgcc_electricity |(会话信息: chrome=120.0.6099.224) sgcc_electricity | 堆栈跟踪:sgcc_electricity | #0 0x562165123233 sgcc_electricity | #1 0x562164ded0fe sgcc_electricity | #2 0x562164e36ba6 sgcc_electricity | #3 0x562164e36cc1 sgcc_electricity | #4 0x562164e84204 sgcc_electricity | #5 0x562164e6444d sgcc_electricity | # 6 0x562164e81680 sgcc_electricity | #7 0x562164e641a3 sgcc_electricity | #8 0x562164e2913e sgcc_electricity | #9 0x562164e2a712 sgcc_electricity | #10 0x5621650f8534 sgcc_electricity | #11 0x5621650fb759 sgcc_electricity | #12 0x5621650fb238 sgcc_electricity | #13 0x5621650fbc05 sgcc_electricity | #14 0x5621650eaabf sgcc_electricity | #15 0x5621650fbf8e sgcc_electricity | #16 0x5621650d4c86 sgcc_electricity | #17 0x5621651143e5 sgcc_electricity | #18 0x5621651145cb sgcc_electricity | #19 0x5621651227bf sgcc_electricity | #200x7f2a18bc6ea7 start_thread sgcc_electricity | sgcc_electricity | 2024-08-28 23:48:22 [错误] ---- Webdriver 异常退出,原因:消息:没有这样的元素:无法找到元素:{“method”:“css selector”,“selector”:“。user”} sgcc_electricity |(会话信息:chrome=120.0.6099.224)sgcc_electricity | Stacktrace:sgcc_electricity | #0 0x562165123233 sgcc_electricity | #1 0x562164ded0fe sgcc_electricity | #2 0x562164e36ba6 sgcc_electricity | #3 0x562164e36cc1 sgcc_electricity | #4 0x562164e84204 sgcc_electricity | #5 0x562164e6444d sgcc_electricity | #6 0x562164e81680 sgcc_electricity | #7 0x562164e641a3 sgcc_electricity | #8 0x562164e2913e sgcc_electricity | #9 0x562164e2a712 sgcc_electricity | #10 0x5621650f8534 sgcc_electricity | #11 0x5621650fb759 sgcc_electricity | #12 0x5621650fb238 sgcc_electricity | #13 0x5621650fbc05 sgcc_electricity | #14 0x5621650eaabf sgcc_electricity | #15 0x5621650fbf8e sgcc_electricity | #16 0x5621650d4c86 sgcc_electricity | #17 0x5621651143e5 sgcc_electricity | #18 0x5621651145cb sgcc_electricity | #19 0x5621651227bf sgcc_electricity | #20 0x7f2a18bc6ea7 start_thread sgcc_electricity | . 剩余 5 次重试。 sgcc_electricity | 2024-08-28 23:48:22 [错误] ---- 状态刷新任务失败,原因是无法解压不可迭代的 NoneType 对象 sgcc_electricity | 回溯(最近一次调用最后一次):sgcc_electricity | 文件“/app/main.py”,第 61 行,在 run_task sgcc_electricity | user_id_list、balance_list、last_daily_date_list、last_daily_usage_list、yearly_charge_list、yearly_usage_list、month_list、month_usage_list、month_charge_list = data_fetcher.fetch() sgcc_electricity | TypeError:无法解压不可迭代的 NoneType 对象 — 直接回复此电子邮件、在 GitHub 上查看或取消订阅。您收到此邮件是因为您订阅了此主题。消息 ID:@.>
已解决大佬,是服务器的问题,我换了台上海的机器就 ok 了