Skip to content

新浪微博简易爬虫并拼接成胡言乱语,不需要登录,读取特定用户近期原创微博

Notifications You must be signed in to change notification settings

TheTarr/weibo_read

 
 

Repository files navigation

weibo_read

使用方法:有python3环境的win朋友我们直接双击0.bat运行,需要requests库。uid就是微博你主页网址后边一串数,输完回车。程序将开始爬取你的所有微博。需要等待较长时间,2分钟左右。之后咱们给出乱语长度,程序开始生成。

第一次爬过、不需要更新数据后,下次使用可以直接双击1.bat。

以下是老哥/老姐原来的readme

新浪微博简易爬虫,读取特定用户原创微博

目前github上排名靠前的几个爬虫都是爬取页面的,有个局限是需要授权,不然会跳到登录页面,非常不友好。

F12后发现微博的ajax接口是没有什么限制的,而且直接返回json,不用处理页面。

要求

  • python3
  • requests
pip install requests

或者用pipenv

pip install pipenv
pipenv install
pipenv shell

运行

python weibo_read.py <uid>

比如打印深圳天气的微博

python weibo_read.py 1871802012

备注

如果一定要用python2来执行,可以在前面添加:

reload(sys)
sys.setdefaultencoding('utf-8')

About

新浪微博简易爬虫并拼接成胡言乱语,不需要登录,读取特定用户近期原创微博

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.2%
  • Batchfile 2.8%