加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

最适合新手练手的爬虫案例——爬取新浪微博用户图片!

发布时间:2020-12-17 01:17:12 所属栏目:Python 来源:网络整理
导读:p style="margin-top:1em;margin-bottom:0px;border:0px;font-size:18px;line-height:inherit;font-family:helvetica,Arial,'Hiragino Sans GB','Microsoft YaHei',simsun;vertical-align:baseline;color:rgb(93,93,93);background-color:rgb(255,255,255);"

<p style="margin-top:1em;margin-bottom:0px;border:0px;font-size:18px;line-height:inherit;font-family:helvetica,Arial,'Hiragino Sans GB','Microsoft YaHei',simsun;vertical-align:baseline;color:rgb(93,93,93);background-color:rgb(255,255,255);">其实,新浪微博用户图片爬虫是我学习python以来写的第一个爬虫,只不过当时懒,后来爬完Lofter后觉得有必要总结一下,所以就有了第一篇爬虫博客。现在暂时闲下来了,准备把新浪的这个也补上。

<p style="margin-top:1em;margin-bottom:0px;border:0px;font-size:18px;line-height:inherit;font-family:helvetica,255);">言归正传,既然选择爬新浪微博,那当然是有需求的,这也是学习的主要动力之一,没错,就是美图。sina用户多数微博都是包含图片的,而且是组图居多,单个图片的较少。

<p style="margin-top:1em;margin-bottom:0px;border:0px;font-size:18px;line-height:inherit;font-family:helvetica,255);">为了避免侵权,本文以本人微博litreily为例说明整个爬取过程,虽然图片较少,质量较低,但爬取方案是绝对ok的,使用时只要换个用户ID就可以了。

<h1 style="margin-top:36px;margin-bottom:22px;padding:0px 0px 0px 14px;border:0px;font-size:18px;line-height:20px;font-family:arial;vertical-align:baseline;background:rgb(255,255) url("/static/style/image/details_headline.png") no-repeat;color:rgb(71,81,87);">分析sina站点<p style="margin-top:1em;margin-bottom:0px;border:0px;font-size:18px;line-height:inherit;font-family:helvetica,255);">获取用户ID

<div class="pgc-img" style="margin:0px;padding:0px;border:0px;font-size:18px;line-height:inherit;font-family:helvetica,255);">

<p class="pgc-img-caption" style="margin-bottom:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;">

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读