Skip to content

新浪微博简易爬虫,不需要登录,读取特定用户所有原创微博

Notifications You must be signed in to change notification settings

fwindpeak/weibo_read

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

weibo_read

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

目前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

新浪微博简易爬虫,不需要登录,读取特定用户所有原创微博

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages