Git Product home page Git Product logo

freeforwenku's Introduction

FreeForWenku

免费下载百度文库收费资料,支持关键字搜索,以及url批量爬取。目前本项目仅对原项目的doc、txt爬取优化,其余的待完成优化。

本项目fork from: https://github.com/Lz1y/FreeForWenku

使用方法:

  • Step 0: Clone项目,安装依赖(本项目基于Python3.6开发)
    pip install -r requirements.txt
    

根据关键词批量爬取

  • Step 1: 修改main.py中的参数
        # 需要修改的参数
        search_word = '一站到底'  #  待搜索关键词
        max_page = 1  # 最大的检索页数
        # 无需求修改的参数
        session = requests.session()
        url_output_dir = os.path.join(os.getcwd(), 'url_outputs')  # 关键词搜索url结果输出位置
        txt_output_dir = os.path.join(os.getcwd(), 'txt_outputs')  # 根据url获取txt文件的输出位置
    
  • Step 2: run main.py

爬取单个doc文件

>>> python get_doc.py -url doc_url -out outputs

例子:

FreeForWenku>>> python get_doc.py -url https://wenku.baidu.com/view/b3ff81bcfbb069dc5022aaea998fcc22bcd14386.html?from=search -out outputs
2019-11-13 16:33:04,641 - utils.logger - DEBUG - Finish process https://wenku.baidu.com/view/b3ff81bcfbb069dc5022aaea998fcc22bcd14386.html?from=search

freeforwenku's People

Contributors

lz1y avatar whxf 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.