Giter Club home page Giter Club logo

quizxue's Introduction

quizXue

学习强国 挑战答题

正如每日、每周、专项答题一样,目的是为了巩固知识,该脚本实现挑战答题辅助功能,可导出Excel题库或磨题帮题库。

采用adb模块获取手机UI布局的xml文件,通过lxml解析出题目内容和选项,答案提交并判断正确后将本题保存到数据库。

OCR截图: 不需针对不同案例设计相应的XPATH规则,但是对截图区域的设置提出要求,得到的数据准确度较高

XML解析:需要根据具体情况设置合适的XPATH规则,获得的数据准确度极高

使用步骤

  1. 安装ADB,并配置环境变量

参考https://github.com/Skyexu/TopSup

  1. 手机连接电脑,开启USB调试模式

  2. python安装虚拟环境和模块

python -m venv venv
(venv)$:pip install -r requirements.txt
  1. 手机进入挑战答题

  2. 运行脚本

(venv)$:python main.py
  1. 直接执行model.py可将数据库导出到题库,可直接使用Ctrl+F搜索答案,也可直接下载使用Excel版本
(venv)$:python model.py

展望: 数据库中未检索到记录时需要手机上提交之后在控制台手动提交添加记录到数据库,希望通过adb shell getevent获取手机输入事件,直接驱动脚本完成数据库的添加和转入下一流程

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.