GithubHelp home page GithubHelp logo

baike_spider's Introduction

baike_spider

使用python编写爬虫程序简单爬取百科百科的1000个页面url链接以及一些内容,算作python的简单入门实例

##这是刚刚学习的一个简单的python入门爬虫程序,主要包含以下内容: ###1、spider_main.py——》python爬虫程序主入口,初始化所有模块,以及调度爬虫任务 ###2、url_manager.py——》url管理器,包括待爬取的url列表和已爬取的url列表,以及判断该url先前是否已经抓取过 ###3、html_downloader.py——》html页面信息下载器,抓取url所在页面的信息 ###4、html_parser.py——》html页面数据解析器,解析当前页面的有效数据以及一些新的url列表 ###5、html_outputer.py——》html页面信息输出器,将爬虫程序抓取的信息输出到一个html页面进行展示

####这个例子还没有进行优化,目前效率比较慢,爬取1000个页面总共耗时403秒,大概7分多钟,后面会慢慢的研究怎么优化提升性能了,慢慢学习!!

baike_spider's People

Contributors

hu1991die avatar

Watchers

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