-
Notifications
You must be signed in to change notification settings - Fork 32
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
运行报错 #7
Comments
X86 linux的话可能要看一下log 里面的用户名啥的是不是带引号“”,如果是带引号就把.env中的所有引号去掉,之前debug好像发现X86 的env解析有问题,你可以试一下 |
日志里显示的 账号是正常的,没有 引号, 我把.env 里 账号和密码的 引号去掉试了一次,还是一样的报错。 |
RETRY_WAIT_TIME_OFFSET_UNIT 设大一点看一下 |
相关几个参数都调大了,试了也不行。 日志结合代码来看,是 driver.get(LOGIN_URL) 没有正常打开,导致 driver.find_element 时报错了? |
我感觉是你的docker 镜像里面没有网络,建议检查一下 |
破案了,是因为机子上有梯子,不知为何,访问国网时走了代理,导致使用外网ip 访问被防火墙了。 暂时关掉梯子 正常登录了,感谢大佬。 |
嗯,那就是网络问题了。我正在更新docker镜像,你可以等待更新到1.4.0版本镜像,去除了opencv镜像会小一点 |
大佬 麻烦看下是什么问题, x86的 机器, 有注册国网账号,账号里也只 绑定了一个户号。日志如下:
2024-06-06 15:03:08 [INFO ] ---- 此次为首次运行,等待时间(FIRST_SLEEP_TIME)为10秒,可在.env中设置
2024-06-06 15:03:18 [INFO ] ---- patching driver executable /usr/bin/chromedriver
2024-06-06 15:03:29 [INFO ] ---- Webdriver initialized.
Traceback (most recent call last):
File "/app/data_fetcher.py", line 245, in fetch
return self._fetch()
File "/app/data_fetcher.py", line 268, in _fetch
if self._login(driver):
File "/app/data_fetcher.py", line 306, in _login
driver.find_element(By.CLASS_NAME, "user").click()
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
2024-06-06 15:04:42 [ERROR ] ---- Webdriver quit abnormly, reason: Message: no such element: Unable to locate element: {"method":"css selector","selector":".user"}
(Session info: chrome=120.0.6099.224)
Stacktrace:
#0 0x563f83e82233
#1 0x563f83b4c0fe
#2 0x563f83b95ba6
#3 0x563f83b95cc1
#4 0x563f83be3204
#5 0x563f83bc344d
#6 0x563f83be0680
#7 0x563f83bc31a3
#8 0x563f83b8813e
#9 0x563f83b89712
#10 0x563f83e57534
#11 0x563f83e5a759
#12 0x563f83e5a238
#13 0x563f83e5ac05
#14 0x563f83e49abf
#15 0x563f83e5af8e
#16 0x563f83e33c86
#17 0x563f83e733e5
#18 0x563f83e735cb
#19 0x563f83e817bf
#20 0x7f2920f3dea7 start_thread
. 5 retry times left.
2024-06-06 15:04:42 [ERROR ] ---- state-refresh task failed, reason is cannot unpack non-iterable NoneType object
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".user"}
(Session info: chrome=120.0.6099.224)
Stacktrace:
#0 0x563f83e82233
#1 0x563f83b4c0fe
#2 0x563f83b95ba6
#3 0x563f83b95cc1
#4 0x563f83be3204
#5 0x563f83bc344d
#6 0x563f83be0680
#7 0x563f83bc31a3
#8 0x563f83b8813e
#9 0x563f83b89712
#10 0x563f83e57534
#11 0x563f83e5a759
#12 0x563f83e5a238
#13 0x563f83e5ac05
#14 0x563f83e49abf
#15 0x563f83e5af8e
#16 0x563f83e33c86
#17 0x563f83e733e5
#18 0x563f83e735cb
#19 0x563f83e817bf
#20 0x7f2920f3dea7 start_thread
Traceback (most recent call last):
File "/app/main.py", line 57, in run_task
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()
TypeError: cannot unpack non-iterable NoneType object
The text was updated successfully, but these errors were encountered: