找回密码
 立即注册

微信扫码登录

搜索
查看: 493|回复: 8

[求助] 关于国网电费查询,青龙和SGCC的滑动验证失败的讨论

[复制链接]

4

主题

15

回帖

119

积分

注册会员

积分
119
金钱
100
HASS币
0
发表于 2025-10-17 09:58:11 | 显示全部楼层 |阅读模式
各位佬们,尝试了青龙面板的x2rr/state-grid方案和add-on模式的ARC-MX/sgcc_electricity_new,都显示滑动验证码失效


青龙面板的x2rr/state-grid方案报错:

⏳ 获取keyCode和publicKey...
[网上国网] [INFO]
✅ 获取keyCode和publicKey成功
🔚 获取keyCode和publicKey结束
⏳ 获取验证码...
[网上国网] [INFO]
✅ 获取验证码凭证成功
[网上国网] [INFO]
✅ 识别验证码成功
🔚 获取验证码结束
⏳ 登录中...
[网上国网] [ERROR]
滑块验证出错, 重新登录: 验证错误!
⏳ 获取验证码...
[网上国网] [INFO]
✅ 获取验证码凭证成功
[网上国网] [INFO]
✅ 识别验证码成功
🔚 获取验证码结束
⏳ 登录中...
🔚 登录结束
🔚 登录结束
[网上国网] [ERROR]
登录失败: 请检查信息填写是否正确!


add-on模式的ARC-MX/sgcc_electricity_new报错:

2025-10-17 09:44:31  [INFO    ] ---- Open LOGIN_URL:https://95598.cn/osgweb/login.
2025-10-17 09:45:08  [INFO    ] ---- find_element 'user'.
2025-10-17 09:45:35  [INFO    ] ---- Click the Agree option.
2025-10-17 09:45:54  [INFO    ] ---- input_elements username :
2025-10-17 09:45:57  [INFO    ] ---- input_elements password :
2025-10-17 09:46:35  [INFO    ] ---- Click login button.
2025-10-17 09:46:45  [INFO    ] ---- Get electricity canvas image successfully.
2025-10-17 09:46:46  [INFO    ] ---- Image CaptCHA distance is 193.
2025-10-17 09:47:15  [INFO    ] ---- Sliding CAPTCHA recognition failed and reloaded.
2025-10-17 09:47:56  [INFO    ] ---- Get electricity canvas image successfully.
2025-10-17 09:47:57  [INFO    ] ---- Image CaptCHA distance is 198.
2025-10-17 09:48:26  [INFO    ] ---- Sliding CAPTCHA recognition failed and reloaded.
2025-10-17 09:50:44  [ERROR   ] ---- Error occurred: Message: Unable to locate element: //*[@id="login_box"]/div[1]/div[1]/div[2]/span; For documentation on this error, please visit: https://www.selenium.dev/documen ... uchelementexception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
. Screenshot saved to /data/errors/screenshots/error_20251017_095040.png
2025-10-17 09:50:44  [ERROR   ] ---- Webdriver quit abnormly, reason: Message: Unable to locate element: //*[@id="login_box"]/div[1]/div[1]/div[2]/span; For documentation on this error, please visit: https://www.selenium.dev/documen ... uchelementexception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
. 5 retry times left.


回复

使用道具 举报

4

主题

15

回帖

119

积分

注册会员

积分
119
金钱
100
HASS币
0
 楼主| 发表于 2025-10-23 14:49:41 | 显示全部楼层
顶顶顶顶顶顶
回复

使用道具 举报

2

主题

29

回帖

177

积分

注册会员

积分
177
金钱
146
HASS币
0
发表于 2025-11-4 18:42:20 | 显示全部楼层
同样报错
回复

使用道具 举报

1

主题

21

回帖

120

积分

注册会员

积分
120
金钱
98
HASS币
0
发表于 2025-11-10 11:49:41 | 显示全部楼层
本帖最后由 nicksnake 于 2025-11-10 11:52 编辑


以下是1.6.8 test报错信息


2025-11-10 11:28:33  [INFO    ] ---- 当前以Homeassistant Add-on 形式运行.
2025-11-10 11:28:33  [INFO    ] ---- The current repository version is v1.6.8-test2, and the repository

address is https://github.com/ARC-MX/sgcc_electricity_new.git
2025-11-10 11:28:33  [INFO    ] ---- The current date is 2025-11-10 11:28:33.
2025-11-10 11:28:33  [INFO    ] ---- start init ErrorWatcher
2025-11-10 11:28:33  [INFO    ] ---- ErrorWatcher init done!
2025-11-10 11:28:34  [INFO    ] ---- The current logged-in user name is 13868777673, the homeassistant

address is http://192.168.88.2:8123, and the program will be executed every day at 18:06.
2025-11-10 11:28:34  [INFO    ] ---- Run job now! The next run will be at 18:06 and 06:06 every day
2025-11-10 11:28:34  [INFO    ] ---- Open Firefox.
2025-11-10 11:29:00  [INFO    ] ---- Webdriver initialized.
2025-11-10 11:29:54  [INFO    ] ---- Open LOGIN_URL:https://95598.cn/osgweb/login.
2025-11-10 11:30:28  [INFO    ] ---- find_element 'user'.
2025-11-10 11:30:53  [INFO    ] ---- Click the Agree option.
2025-11-10 11:31:11  [INFO    ] ---- input_elements username : ***
2025-11-10 11:31:14  [INFO    ] ---- input_elements password : ***
2025-11-10 11:31:52  [INFO    ] ---- Click login button.
2025-11-10 11:31:58  [INFO    ] ---- Get electricity canvas image successfully.
2025-11-10 11:31:59  [INFO    ] ---- Image CaptCHA distance is 325.
2025-11-10 11:32:25  [INFO    ] ---- Sliding CAPTCHA recognition failed and reloaded.
2025-11-10 11:35:12  [ERROR   ] ---- Error occurred: Message: Unable to locate element: //*

[@id="login_box"]/div[1]/div[1]/div[2]/span; For documentation on this error, please visit:

https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
. Screenshot saved to /data/errors/screenshots/error_20251110_113509.png
2025-11-10 11:35:12  [ERROR   ] ---- Webdriver quit abnormly, reason: Message: Unable to locate element: //*

[@id="login_box"]/div[1]/div[1]/div[2]/span; For documentation on this error, please visit:

https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
. 5 retry times left.
回复

使用道具 举报

1

主题

21

回帖

120

积分

注册会员

积分
120
金钱
98
HASS币
0
发表于 2025-11-10 11:54:16 | 显示全部楼层
以下是未升级前V1.6.8报错信息:

2025-11-10 05:58:00  [INFO    ] ---- Open Firefox.
2025-11-10 05:58:27  [INFO    ] ---- Webdriver initialized.
2025-11-10 05:59:22  [INFO    ] ---- Open LOGIN_URL:https://95598.cn/osgweb/login.
2025-11-10 05:59:56  [INFO    ] ---- find_element 'user'.
2025-11-10 06:00:28  [INFO    ] ---- Click the Agree option.
2025-11-10 06:00:48  [INFO    ] ---- input_elements username : ***
2025-11-10 06:00:51  [INFO    ] ---- input_elements password : ***
2025-11-10 06:01:29  [INFO    ] ---- Click login button.
2025-11-10 06:01:40  [INFO    ] ---- Get electricity canvas image successfully.
2025-11-10 06:01:41  [INFO    ] ---- Image CaptCHA distance is 76.
2025-11-10 06:02:10  [INFO    ] ---- Sliding CAPTCHA recognition failed and reloaded.
2025-11-10 06:04:01  [ERROR   ] ---- Webdriver quit abnormly, reason: Message: Unable to locate element: //*[@id="login_box"]/div[1]/div[1]/div[2]/span; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
. 5 retry times left.
回复

使用道具 举报

1

主题

13

回帖

61

积分

注册会员

积分
61
金钱
47
HASS币
0
发表于 2025-11-10 14:18:57 | 显示全部楼层
ARC-MX/sgcc_electricity_new的可以试试把配置项中的RETRY_WAIT_TIME_OFFSET_UNIT调大,我一开始也不行,调大到30后登录成功了
回复

使用道具 举报

1

主题

20

回帖

113

积分

注册会员

积分
113
金钱
92
HASS币
0
发表于 2025-11-14 09:18:52 | 显示全部楼层
本帖最后由 gaofei930 于 2025-11-14 09:48 编辑

用了青龙面板的x2rr/state-grid方案,怎么不行?

获取keyCode和publicKey...
🔚 获取keyCode和publicKey结束
[网上国网] [ERROR]
获取keyCode和PublicKey失败: TypeError: Cannot destructure property 'body' of 'undefined' as it is undefined.
回复

使用道具 举报

0

主题

7

回帖

69

积分

注册会员

积分
69
金钱
62
HASS币
0
发表于 2025-11-17 11:12:08 | 显示全部楼层
废了,已经很多天滑动验证失败了
回复

使用道具 举报

0

主题

5

回帖

37

积分

新手上路

积分
37
金钱
32
HASS币
0
发表于 4 天前 | 显示全部楼层
有没有现成的代码学习一下,大家一起攻克
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-12-2 12:57 , Processed in 0.088074 second(s), 13 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表