Coder Social home page Coder Social logo

crawler_baidu's Introduction

crawler_baidu

python版本号:2.7.13。

此爬虫项目是利用python的urllib和urllib2来实现的。

爬取思路: 1.百度贴吧搜索链接为:http://tieba.baidu.com/f?&kw=%E4%B8%AD%E5%9B%BD%E8%81%94%E9%80%9A kw=%E4%B8%AD%E5%9B%BD%E8%81%94%E9%80%9A实际上就是kw=**联通 第2页面的链接为:http://tieba.baidu.com/f?kw=%E8%81%94%E9%80%9A&pn=50 分析得出:每一页的显示内容pn=(n-1)*50 2.利用urllib.urlencode方法对用户输入的贴吧名称转换,并拼接出来用户搜索贴吧的完整路径 3.根据用户输入的起始页和结束页进行爬取 4.get_html函数用老爬取html内容 5.save_html函数进行爬取数据的保存 6.load_crawler函数进行完整带页码的url,并爬取保存.

crawler_baidu's People

Contributors

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