GithubHelp home page GithubHelp logo

baidutieba's Introduction

百度贴吧scrapy爬去

  • 先爬取列表页每一行的title和url,再去详情页爬去img的url

注意点

  • 猫吧的第一页里面内容被放在<!-- --->注释里面,需要用正则取出来后,再用etree解析,不能直接用scrapy框架的选择器
  • 爬去列表的href中的url链接不完整,只是uri,需要与域名拼接
    • 1:用urlib.parse.urljoin(response.url,uri)
    • 2.直接用response.follow(uri) -我设置了列表页的最大爬去页数,要不爬太久了,可以自行修改max_page.

baidutieba's People

Contributors

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