GithubHelp home page GithubHelp logo

crawlerproject's Introduction

Python 爬虫


开发环境

  • Windows 7 64位
  • python 3.6
  • Visual Studio 2017

准备工具

  • requests: 用于请求网络
  • beautifulsoup: 用于操作 html 数据
  • wkhtmltopdf: 用来把获取到的网络的 html 文件转换为 PDF 文件; 其中所使用的 pdfkit 是 wkhtmltopdf 的Python封装包

所以,需要先安装好下面的依赖包:

pip install requests
pip install beautifulsoup4
pip install pdfkit

然后需要在wkhtmltopdf官网下载稳定版进行安装,安装完成之后把该程序的执行路径加入到系统环境 $PATH 变量中(若在安装的时候将选择信息的两个选项打钩,安装过程中会自动将路径添加到环境变量)。

运行

  1. 以命令行的形式:

     python RunoobToPdf.py
    
  2. 或者在IED环境中直接点击图标 运行

说明

  1. 在末尾 Other 附有该程序的部分解读。

  2. 该程序是爬取RUNOOB.COM网站上的Python3教程并转换成 PDF 文档,若需爬取该网站其他信息或者其他网站,只需要做部分修改即可。

  3. 在该仓库中,附带有作者爬取到的RUNOOB.COM中的 Python3教程

  4. 另外,还附带有廖雪峰的官方网站中的Python3教程,可以做学习使用。

效果图

该程序是在号称宇宙最强的IED Visual Studio 2017 环境下编写的,其编辑界面如图:

爬虫运行完成之后,生成的 PDF 文件界面如图:

Other

Author: Regan_Chai

E-Mail: [email protected]

CSDN: https://blog.csdn.net/u012319441/article/details/80032068

crawlerproject's People

Contributors

reganchai avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.