Code Monkey home page Code Monkey logo

study_score's Introduction

谷歌浏览器+driver+python安装包(Windows版本)

链接:https://pan.baidu.com/s/1VswwG0x4jdZ07hHeiSVohg 
提取码:glj8 
复制这段内容后打开百度网盘手机App,操作更方便哦

1.配置selenium的谷歌浏览器(上面的链接有资源)

到http://npm.taobao.org/mirrors/chromedriver/ 下载对应自己谷歌浏览器版本的chromedriver(
我使用的谷歌浏览器版本号和chromedriver已上传,仅供参考
鄙人使用谷歌浏览器版本号win32_71.0.3578.80

下载好的chromedriver.exe复制到谷歌浏览器的根目录

并把所在的目录加入到环境变量中,win7需要重启才能生效

再复制一份到Python的根目录

2.环境安装

安装Python环境,到Python官网下载Python版本,安装加入环境变量(请查看根目录的图片)
在项目目录下,pip install -r requirments.txt 即可

3.运行spider目录下的set_cookie.py文件

手动点击登陆,60s内完成扫码登陆,等待程序关闭,cookie获取成功(保存登录数据)

4.运行(建议使用分开模块)

study.py为总程序,包含文章和视频(容易报错)

建议使用分模块,step_content.py和step_vedio.py。两个程序可以同时运行,互不干扰

study_score's People

Contributors

needones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

study_score's Issues

it doesn't work for me

I've checked the cookie file,
D:\study_score-master\cookie\cookie.json
It's like this:

[{'domain':` 'xuexi.cn', 'expiry': 1560931759.294422, 'httpOnly': False, 'name': 'token', 'path': '/', 'secure': False, 'value': '818e735c2e4c4c52acdc9049457382d2'}, {'domain': 'xuexi.cn', 'expiry': 1592446112.386617, 'httpOnly': False, 'name': '__UID__', 'path': '/', 'secure': False, 'value': '2342fcc0-9237-11e9-8327-c1dd3b179f3c'}]

then I got this error

Traceback (most recent call last):
  File "D:\study_score-master\spider\step_content.py", line 34, in <module>
    driver.add_cookie(i)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 894, in add_cookie
    self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'
  (Session info: headless chrome=75.0.3770.100)

why is the argument 'expiry' invalid?

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.