Git Product home page Git Product logo

Comments (3)

scratlzj avatar scratlzj commented on June 1, 2024

虽然出现这个错误提示,最后还是成功爬完写入了,不过应该是会漏掉些微博.我Google keyerror 错误得到这个网页,供您参考.

from weibo-crawler.

dataabc avatar dataabc commented on June 1, 2024

感谢反馈,错误已经修复。原因是某些微博需要登录才可以查看,导致获取失败。目前发现这些特殊微博仅出现在微博详情页,程序只有在发现微博是长微博时才会访问详情页以获取微博全部内容,其它情况只访问微博列表页。目前的解决方案是,发现长微博时尝试访问详情页,如果发现获取失败就从列表页解析该微博。二者的区别主要是详情页可以获取微博正文的全部内容,列表页只能获取正文的部分内容,其它主要信息如点赞、评论、分享等信息没有区别。
如果想要获取长微博正文的全部内容,可以添加在request.get时添加cookie信息,虽然这样就背离里免cookie的主旨。加上cookie后就可以爬取全部微博了,不会漏掉微博。这种需要登录才可以访问的微博数量并不多,大约在5%左右,因为测试的范围较小,不一定准确。如果介意这少量的微博,可以添加cookie解决,否则可以忽略。

from weibo-crawler.

scratlzj avatar scratlzj commented on June 1, 2024

这主要是微博限制过多。谢谢,祝您下半年涨工资。

from weibo-crawler.

Related Issues (20)

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.