Giter VIP home page Giter VIP logo

crawlcnki's Introduction

crawlCnki

爬取知网论文

504
HTTP Error 504: Gateway Time-out
Traceback (most recent call last):
  File "C:/code/cnkiCrawl/crawl_cnki.py", line 108, in <module>
    crawler.download_paper(treedata, opener, localdir)
  File "C:\code\cnkiCrawl\crawler.py", line 60, in download_paper
    fail_log.write(paper_title + str(error) + str(error.code))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)
  1. 请求搜索结果的列表页,需要发送两次请求,带cookie
  2. 请求下一页时,需要修改referer,下载论文时,一样需要修改referer
  3. 爬取失败后,修改UA,继续从失败页码开始新爬取
  4. 不要太粗暴,爬取一页,休息一会儿

待修改地方:

  1. 爬取到最后一页的时候,不能够停止,会一直爬取最后一页
  2. 爬取失败的论文列表需要保存下来,最后进行重试

源码来自tom522,在此鸣谢

crawlcnki's People

Contributors

tom523 avatar divingcats avatar

Watchers

James Cloos avatar

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.