Giter VIP home page Giter VIP logo

xxqg's Introduction

xuexi

python chrome release license stars forks downloads

此脚本最后测试于2022/03/08,运行正常

声明

  1. 使用此脚本则默认同意以下声明
  2. 本项目仅用于学习Python,严禁将其用于任何违法用途
  3. 请端正学习态度,严禁将本项目用于任何形式的刷分行为
  4. 因使用此脚本造成的账号风控、账号封禁等后果,均自行承担

特色

  1. 支持浏览文章,观看视频,自动答题(每日答题,每周答题,专项答题),一天45分
  2. 无需手动操作,浏览器全程静音,无感刷视频
  3. 全程无人值守,结束任务后自动关闭浏览器
  4. 多种随机操作,模拟真人操作,提高安全性
  5. 软件包兼容win10/11(其他系统可clone项目运行xuexi.py

开始:

  1. 可以将源码下载或clone到本地仓库,自行编译运行,也可以在 Release 中下载我已经编译了的版本
  2. 请确保你电脑中已经安装最新chrome浏览器,没有安装请先去 https://www.google.cn/chrome/ 下载安装
  3. 点击运行 xuexi.exe ,根据提示进行操作
  4. 脚本运行过程中请勿关闭或最小化浏览器,否则可能会失败,并且可能有检测风险
  5. 可将脚本控制台置于最前,查看运行进度

安全:

  1. 为了确保账号的安全,建议刷了几天脚本后人工刷一两天
  2. 请勿频繁刷题,高频刷题可能有风险

设置:

  1. 支持对自动答题、浏览文章、观看视频、更新驱动等进行设置
  2. 设置可以在 data/settings.json中修改,true表示执行,false表示不执行
  3. 【注意】只有当“自动答题”为true时,其他答题设置才会生效

已知问题:

  1. 如果win10/11报毒,加白名单就好,这是Python打包的问题,与程序无关,开源项目放心使用,不放心可以clone源码运行
  2. 如果脚本控制台长时间不动,可以尝试输入回车或重启脚本
  3. 如果使用时还有其他问题,欢迎提issue反馈

打包

如果有小伙伴需要自己修改代码打包项目的,可以使用pyinstaller

  1. 安装

pip install pyinstaller

  1. 在终端进入项目文件夹,执行如下命令,参数可以根据自己需要修改

pyinstaller -F -c -i .\xxqg.ico -p 项目路径 .\xuexi.py

运行效果图

程序效果图

观看视频效果图

浏览文章效果图

答题效果图

项目结构树

+--custom                            # 自定义webdriver模块
|      +--xuexi_chrome.py
|      +--__init__.py
+--data                              # 程序运行所需数据文件及配置文件
|      +--articles.json
|      +--lastTime.json
|      +--settings.json
|      +--videos.json
+--getData                           # 数据获取模块
|      +--dataTimeOperation.py
|      +--get_article.py
|      +--get_video.py
|      +--version.py
|      +--__init__.py
+--operation                         # 程序核心模块
|      +--check_version.py
|      +--exam.py
|      +--get_chromedriver.py
|      +--scan_article.py
|      +--watch_video.py
|      +--__init__.py
+--userOperation                     # 用户相关模块
|      +--check.py
|      +--login.py
|      +--logout.py
|      +--__init__.py
+--xuexi.py                          # 主程序入口
+--__init__.py

License

MIT

Copyright (c) 2020-present PRaichu

xxqg's People

Contributors

devin-kung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xxqg's Issues

碰到视频问题后会报错

建议碰到视频问题后跳过这一部分继续执行其他答题。
要不每次碰到有视频答题的问题就会一直卡壳

1.5.0有BUG

没有开每周答题的时间开关,出现这个错误提示,重开还提示。

->请在5分钟丙扫码完成登录>登录成功|每日登录|选读文章|视频数量|视频时长|每日答题|每周答题|专项答题|今日累计积分|成长总积分|1分/1分 |12分/12分 |6分/6分|6分/6分|5分/5分|0分/5分|0分/10分|30分|14847分>当前题目进度:1/5最大概率选项:AB当前题自进度:2/5最大概率选项:C当前题自进度:3/5最大概萃选项:A当前题自进度:4/5最大概率选项:A当前题自进度:5/5最大概率选项:ABCD-->

答题结束Alert Text:{Alert text:
Message:unexpected alert open:fAlert text:}(Session info:chrome=88.0.4324.182)>程序异常,请尝试重启脚本HOLE请按任意键继续

提issue须知

首先非常感谢大家的支持与反馈
但在反馈问题时请注意以下几点,这样有助于更快速的定位问题和解决问题

  1. 提issue前请先看一下该问题是否已经有人提出过了,请不要重复提相同的问题
  2. 反馈bug的时候请描述清楚出现问题的过程、浏览器的截图(如果有的话)和控制台输出的日志

感谢大家的理解!

1.0.81报错。

谷歌浏览器是92.0.4515.107 ,执行插件,提示有chromedriver更新,更新完就报错,发现自动更新了93的chromedriver,后来卸载浏览器装93开发者版浏览器也是报错。

--> 当前chromedriver不是最新,准备进行更新
--> chromedriver下载成功
--> 解压成功
--> 压缩包已删除
--> chromedriver更新成功

Traceback (most recent call last):
File "xuexi.py", line 113, in
File "custom\xuexi_chrome.py", line 10, in init
File "selenium\webdriver\chrome\webdriver.py", line 76, in init
File "selenium\webdriver\remote\webdriver.py", line 157, in init
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 93
Current browser version is 92.0.4515.107 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.1
请按任意键继续. . .

以上是自动更新chromedriver后的报错。

Traceback (most recent call last):
File "xuexi.py", line 113, in
File "custom\xuexi_chrome.py", line 10, in init
File "selenium\webdriver\chrome\webdriver.py", line 76, in init
File "selenium\webdriver\remote\webdriver.py", line 157, in init
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 93
Current browser version is 92.0.4515.107 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.1
请按任意键继续. . .

以上是更新chromedriver后重启再次执行的报错。

大哥!维护一下吧~~

Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div[2]/div/div[3]/div[2]/div[2]/div[3]/div[1]/div[2]"}
(Session info: chrome=91.0.4472.77)

最新版本 Win10报错 无法启动

Traceback (most recent call last):
File "urllib3\connectionpool.py", line 696, in urlopen
File "urllib3\connectionpool.py", line 964, in prepare_proxy
File "urllib3\connection.py", line 359, in connect
File "urllib3\connection.py", line 496, in connect_tls_proxy
File "urllib3\util\ssl
.py", line 432, in ssl_wrap_socket
File "urllib3\util\ssl
.py", line 474, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 1040, in _create
File "ssl.py", line 1309, in do_handshake
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1122)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "requests\adapters.py", line 439, in send
File "urllib3\connectionpool.py", line 755, in urlopen
File "urllib3\util\retry.py", line 573, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.xuexi.cn', port=443): Max retries exceeded with url: /lgdata/u1ght1omn2.json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "xuexi.py", line 110, in
File "getData\get_article.py", line 18, in get_article
File "requests\api.py", line 76, in get
File "requests\api.py", line 61, in request
File "requests\sessions.py", line 542, in request
File "requests\sessions.py", line 655, in send
File "requests\adapters.py", line 514, in send
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.xuexi.cn', port=443): Max retries exceeded with url: /lgdata/u1ght1omn2.json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)')))

--> 程序异常,请尝试重启脚本

  __/\\\\\\\\\\\\\____/\\\________/\\\__________/\\\\\\\\\\\\__/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\_
   _\/\\\/////////\\\_\///\\\____/\\\/_________/\\\//////////__\/\\\////////\\\__\/\\\///////////__
    _\/\\\_______\/\\\___\///\\\/\\\/__________/\\\_____________\/\\\______\//\\\_\/\\\_____________
     _\/\\\\\\\\\\\\\\______\///\\\/___________\/\\\____/\\\\\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\_____
      _\/\\\/////////\\\_______\/\\\____________\/\\\___\/////\\\_\/\\\_______\/\\\_\/\\\///////______
       _\/\\\_______\/\\\_______\/\\\____________\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\_____________
        _\/\\\_______\/\\\_______\/\\\____________\/\\\_______\/\\\_\/\\\_______/\\\__\/\\\_____________
         _\/\\\\\\\\\\\\\/________\/\\\____________\//\\\\\\\\\\\\/__\/\\\\\\\\\\\\/___\/\\\_____________
          _\/////////////__________\///______________\////////////____\////////////_____\///______________

请按任意键继续. . .

1.0.8.0缺少

报错如下:
Traceback (most recent call last):
File "E:/xxqg-1.0.8.0/xuexi.py", line 116, in
exam_temp_Path = './data/exam_temp.json'

应该是/data/exam_temp.json文件没有,这个文件能发一下吗?

1.0.8.2打开以后报错

Traceback (most recent call last):
File "xuexi.py", line 113, in
File "custom\xuexi_chrome.py", line 11, in init
File "selenium\webdriver\chrome\webdriver.py", line 81, in init
File "selenium\webdriver\remote\webdriver.py", line 157, in init
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot create temp dir for user data dir

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.2
请按任意键继续. . .

当前版本:1.0.8.1 保错

Traceback (most recent call last):
File "xuexi.py", line 113, in
File "custom\xuexi_chrome.py", line 10, in init
File "selenium\webdriver\chrome\webdriver.py", line 76, in init
File "selenium\webdriver\remote\webdriver.py", line 157, in init
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.1
请按任意键继续. . .

关于每周答题

希望可以加入日期检测,固定每周几答题,不用手动修改配置json

1.0.8.3 程序异常

Traceback (most recent call last):
File "xuexi.py", line 113, in
File "custom\xuexi_chrome.py", line 14, in init
File "selenium\webdriver\chrome\webdriver.py", line 81, in init
File "selenium\webdriver\remote\webdriver.py", line 157, in init
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 93.0.4577.63 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.3
请按任意键继续. . . 2021-9-9

--> 程序当前版本号:1.0.8.2,最新版本号:1.0.8.3,该版本可能已过时,建议下载最新版本以获得更好的体验!
--> 下载地址:https://github.com/PRaichu/xxqg/releases/latest
--> 当然,你也可以选择不更新,这不会影响当前程序的使用!

Traceback (most recent call last):
File "xuexi.py", line 113, in
File "custom\xuexi_chrome.py", line 11, in init
File "selenium\webdriver\chrome\webdriver.py", line 81, in init
File "selenium\webdriver\remote\webdriver.py", line 157, in init
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 93.0.4577.63 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.2
请按任意键继续. . . 2021-9-9

当前版本:1.0.8.2 程序异常,请尝试重启脚本

Traceback (most recent call last):
File "xuexi.py", line 134, in
File "xuexi.py", line 36, in user_login
File "userOperation\login.py", line 17, in login
File "selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
File "selenium\webdriver\remote\webdriver.py", line 978, in find_element
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div/div/div[1]"}
(Session info: chrome=93.0.4577.63)

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.2

学习强国V1.0.8.1报错,不知道如何解决?

image
exe文件执行,如图计算机丢失api-ms-win-croe-path-l1-1-0.dll。py代码运行,报错== RESTART: C:\Users\Administrator\Desktop\xxqg-master(1)\xxqg-master\xuexi.py =
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\xxqg-master(1)\xxqg-master\operation\get_chromedriver.py", line 13, in do
version = get_version(program_path)
File "C:\Users\Administrator\Desktop\xxqg-master(1)\xxqg-master\operation\get_chromedriver.py", line 66, in get_version
return version_info.split(' ')[1]
IndexError: list index out of range

--> 程序异常,请确保你的chrome浏览器是最新版本,然后重启脚本

1.0.8.1报错

Traceback (most recent call last):
File "operation\get_chromedriver.py", line 13, in do
File "operation\get_chromedriver.py", line 66, in get_version
IndexError: list index out of range

chrome是最新版本 chromedriver也是对应的版本 大神求解答

每周答题切换至第2页报错

--> 请在5分钟内完成登录
--> 登录成功
┌────────┬────────┬────────┬────────┬───────┬────────┬───────┬────────┬───────┐
│ 每日 … │ 选读 … │ 视频 … │ 视频 … │ 每日… │ 每周 … │ 专项… │ 今日 … │ 成长… │
├────────┼────────┼────────┼────────┼───────┼────────┼───────┼────────┼───────┤
│ 1分/1… │ 12分/… │ 6分/6… │ 6分/6… │ 5分/… │ 0分/5… │ 0分/… │ 33分 │ 1106… │
└────────┴────────┴────────┴────────┴───────┴────────┴───────┴────────┴───────┘
Message: stale element reference: element is not attached to the page document
(Session info: chrome=88.0.4324.146)

--> 程序异常,请尝试重启脚本

----------------------------------------------------------------------------------------------------------------------------------------------上面这个报错是什么原因?调试发现是在每周答题切换至第2页报错,辛苦大神看下。

1.0.4.0每次运行每周答题答第五题结束就会出错退出。

1.0.4.0每次运行每周答题答第五题结束就会出错退出。也没有得到每周答题的积分。
设置是
{
"浏览文章": "true",
"观看视频": "true",
"自动答题": "true",
"每日答题": "true",
"每周答题": "true",
"专项答题": "true"
}
谷歌浏览器版本:chrome=88.0.4324.190

错误提示:

│ 每日登录 │ 选读文章 │ 视频数量 │ 视频时长 │ 每日答题 │ 每周答题 │ 专项答题 │ 今日累计积分 │ 成长总积分 │
├──────────┼───────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────────┼────────────┤
│ 1分/1分 │ 12分/12分 │ 6分/6分 │ 6分/6分 │ 5分/5分 │ 0分/5分 │ 0分/10分 │ 30分 │ 14887分 │
└──────────┴───────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────────┴────────────┘
--> 当前题目进度:1/5
--> 最大概率选项: A B
--> 当前题目进度:2/5
--> 最大概率选项: C
--> 当前题目进度:3/5
--> 最大概率选项: A
--> 当前题目进度:4/5
--> 最大概率选项: A
--> 当前题目进度:5/5
--> 最大概率选项: A B C D
--> 答题结束
Alert Text: {Alert text :
Message: unexpected alert open: {Alert text : }
(Session info: chrome=88.0.4324.190)

--> 程序异常,请尝试重启脚本

连续运行了多次,每次都出这个错误。

运行时,提示缺少文件!!

[Errno 2] No such file or directory: './data/exam_temp.json'
--> 程序异常,请尝试重启脚本
Traceback (most recent call last):
File "G:\autoxuexi-2.1.0\xxqg-master\xuexi.py", line 115, in
os.remove(exam_temp_Path)
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: './data/exam_temp.json'

关于专项答题的一点建议

最近(1.0.6.0)以来,专项时不时会出现9分,程序检查积分时发现分数不够,会自动开始新一轮答题,造成第二轮只得1分。这样其实有点浪费分数,因为第二轮的题目得1分以后不能重复得分,能否把专项答题的规则改成每日一次?
个人意见,仅供参考,不喜勿喷。
谢谢作者的努力!

启动报错程序异常退出

系统:win10专业版64
程序版本:1.0.6.1
浏览器版本91.0.4472.77(正式版本) (64 位)
chromedriver版本91.0.4472.19/
可以启动 登陆以后先查看积分情况 然后就报错,浏览器直接关闭,控制台提示异常
1

1.08出现报错。

Traceback (most recent call last):
File "urllib3\connectionpool.py", line 699, in urlopen
File "urllib3\connectionpool.py", line 382, in make_request
File "urllib3\connectionpool.py", line 1010, in validate_conn
File "urllib3\connection.py", line 411, in connect
File "urllib3\util\ssl
.py", line 428, in ssl_wrap_socket
File "urllib3\util\ssl
.py", line 472, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 1040, in _create
File "ssl.py", line 1309, in do_handshake
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "requests\adapters.py", line 439, in send
File "urllib3\connectionpool.py", line 755, in urlopen
File "urllib3\util\retry.py", line 531, in increment
File "urllib3\packages\six.py", line 734, in reraise
File "urllib3\connectionpool.py", line 699, in urlopen
File "urllib3\connectionpool.py", line 382, in make_request
File "urllib3\connectionpool.py", line 1010, in validate_conn
File "urllib3\connection.py", line 411, in connect
File "urllib3\util\ssl
.py", line 428, in ssl_wrap_socket
File "urllib3\util\ssl
.py", line 472, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 1040, in _create
File "ssl.py", line 1309, in do_handshake
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接 。', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "xuexi.py", line 92, in
File "operation\check_version.py", line 24, in check
File "operation\check_version.py", line 14, in get_latest_version
File "requests\api.py", line 76, in get
File "requests\api.py", line 61, in request
File "requests\sessions.py", line 542, in request
File "requests\sessions.py", line 655, in send
File "requests\adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

--> 程序异常,请尝试重启脚本
--> 当前版本:1.0.8.0
请按任意键继续. . .

登录QR显示不完整

经过分析,browser.execute_script('arguments[0].scrollIntoView();', login_QR_box)
会导致QR在内框iframe内滚动
去掉切换到内部iframe,并改成browser.execute_script('arguments[0].scrollIntoView();', iframe)
解决问题

1.0.8.0和1.0.8.1均报错

win 10操作系统,错误信息如下,似乎是找不到视频控件
Traceback (most recent call last):
File "xuexi.py", line 136, in
File "xuexi.py", line 59, in run
File "operation\watch_video.py", line 27, in watch_video
File "selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
File "selenium\webdriver\remote\webdriver.py", line 976, in find_element
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div/div/section/div/div/div/div/div[2]/section/div/div/div/div/div/div/div/div[1]/div[2]/div/div[1]/div[1]/div/video"}
(Session info: chrome=92.0.4515.159)

每周答题和专项答题不好使了

下载最新的1.30版本的,运行脚本,其他都正常,每日答题也正常,就是每周答题和专项答题,一进答题界面就会跳转到每日答题那里,然后就提示提交已到上限。

WIN10 无法运行

HTTPSConnectionPool(host='www.xuexi.cn', port=443): Max retries exceeded with url: /lgdata/u1ght1omn2.json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)')))
--> 程序异常,请尝试重启脚本

好像是我这网络的问题

1.0.6版本答题报错

Traceback (most recent call last):
File "xuexi.py", line 114, in
File "xuexi.py", line 44, in run
File "userOperation\check.py", line 51, in check_task
File "selenium\webdriver\remote\webdriver.py", line 333, in get
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 241, in check_response
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: {Alert text :
Message: unexpected alert open: {Alert text : }
(Session info: chrome=91.0.4472.77)

非常棒的代码

教科书般的代码范本,流程清晰,连我这种半拉子都能看懂。作者一定是python大佬,该项目值得学习。

程序异常

Traceback (most recent call last):
File "xuexi.py", line 114, in
File "xuexi.py", line 44, in run
File "userOperation\check.py", line 51, in check_task
File "selenium\webdriver\remote\webdriver.py", line 333, in get
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 241, in check_response
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: {Alert text :
Message: unexpected alert open: {Alert text : }
(Session info: chrome=91.0.4472.77)

--> 程序异常,请尝试重启脚本

双击Exe打开报错

双击exe,打开报错。报错信息为:无法启动此程序,因为计算机中丢失api-ms-win-core-path-|1-1-0.dll。尝试重新安装该程序以解决此问题。
微信图片_20210302160912

每次登录后,切换3次页面就退出

--> 请在5分钟内完成登录
--> 登录成功
Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div[2]/div/div[3]/div[2]/div[2]/div[3]/div[1]/div[2]"}
(Session info: chrome=90.0.4430.212)

--> 程序异常,请尝试重启脚本

chromedriver.exe 是和系统版本一致的 90.0.4430.xxx
换其他XXQG账号登录,没有问题,就是某一个账号一直出现这样的问题,以前都正常
用的1.04、1.05,都有是这样

对于每日答题中的视频答题,添加了一个题库查询

def get_ans_from_db(question):
"""
:param question:
:return:
"""
try:
import sqlite3
conn = sqlite3.connect('./data/tiku.db')
sql = "select answer from tiku where question like '%" + question + "%'"
cursor = conn.cursor()
values = cursor.execute(sql).fetchall()
if len(values) > 0:
return values[0][0]
else:
return '不知道'
except:
return '不知道'

1.0.8.1报错

Traceback (most recent call last):
File "xuexi.py", line 134, in
File "xuexi.py", line 36, in user_login
File "userOperation\login.py", line 15, in login
File "selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
File "selenium\webdriver\remote\webdriver.py", line 976, in find_element
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div[2]/div[2]/div[1]/div/div/div/iframe"}
(Session info: chrome=91.0.4472.77)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.