先上完整代码
import requests
import time
import datetime
import os
import json
import uuid
from pyquery import PyQuery as pq # 地址 https://www.zhihu.com/question/34243513
def start(offset, sort):
url = 'https://www.zhihu.com/api/v4/questions/34243513/answers?include=data%5B%2A%5D.is_normal%2Cadmin_closed_comment%2Creward_info%2Cis_collapsed%2Cannotation_action%2Cannotation_detail%2Ccollapse_reason%2Cis_sticky%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2Ccan_comment%2Ccontent%2Ceditable_content%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Ccreated_time%2Cupdated_time%2Creview_info%2Crelevant_info%2Cquestion%2Cexcerpt%2Crelationship.is_authorized%2Cis_author%2Cvoting%2Cis_thanked%2Cis_nothelp%2Cis_labeled%3Bdata%5B%2A%5D.mark_infos%5B%2A%5D.url%3Bdata%5B%2A%5D.author.follower_count%2Cbadge%5B%2A%5D.topics&limit=5&offset=' + str(
offset) + '&platform=desktop&sort_by=' + sort
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36',
'cookie': '_zap=d62a474a-43dc-450a-bdcc-cb807357f4ab; _xsrf=3999fea2-0356-42e7-8d2a-ac968d594c86; d_c0="AEDkV8GlCw-PTjUrBeB6hDjqwntD_bakBL8=|1551259687";q_c1=7d117a8c0f564a3ea2a20d02f83e3bb1|1551259688000|1551259688000; tgw_l7_route=66cb16bc7f45da64562a077714739c11'
}
res = requests.get(url, headers=headers).text
data = json.loads(res)
picRepo = 'picRepo'
if not os.path.exists(picRepo):
os.makedirs(picRepo)
if data.get("data"):
for i, item in enumerate(data['data']):
content = pq(item['content'])
imgUrls = content.find('noscript img').items()
for imgTag in imgUrls:
src = imgTag.attr("src")
strIndex = src.rfind('.')
suffix = src[strIndex:]
with open(f"{picRepo}/{uuid.uuid4()}{suffix}", 'wb') as f:
f.write(requests.get(src).content) if __name__ == '__main__':
starttime = datetime.datetime.now()
strTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
stime = print(f'开始抓取,当前时间: {strTime}')
for i in range(3): # 偏移量单位是5,循环3次
start(offset=((i * 5) if i != 0 else 0), sort='updated') # updated:按时间降序,default:默认排序
# 这里先睡一会,如果太快可能有些图片下载后会查看不了,
# 越慢,下载的图片可以查看的越多。原因大概是知乎的反爬虫机制,
# 看不了的图片其实返回的是一个400的badRequest的状态码
time.sleep(3)
endtime = datetime.datetime.now()
print(f'抓取完毕,用时 {((endtime - starttime).seconds)} 秒:')
如果遇到以下问题,只要将py脚本转一下编码就行了
SyntaxError: Non-UTF-8 code starting with '\xbf' in file python-zhihu -v1.2.py on line 34, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
前期准备工作:
1,安装python3
https://www.python.org/ftp/python/3.7.2/python-3.7.2.exe
2,安装所需要的第三方模块
安装需要的模块
pip install requests
pip install PyQuery
pip show 命令检查模块是否安装成功(如图所示是成功的)
C:\Users\addiction\Desktop\zhihu-take>pip show requests
Name: requests
Version: 2.21.0
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: [email protected]
License: Apache 2.0
Location: c:\users\addiction\appdata\local\programs\python\python37-32\lib\site-packages
Requires: chardet, certifi, urllib3, idna
Required-by:
----------------------------------------------------------
C:\Users\addiction\Desktop\zhihu-take>pip show PyQuery
Name: pyquery
Version: 1.4.0
Summary: A jquery-like library for python
Home-page: https://github.com/gawel/pyquery
Author: Gael Pasgrimaud
Author-email: [email protected]
License: BSD
Location: c:\users\addiction\appdata\local\programs\python\python37-32\lib\site-packages
Requires: cssselect, lxml
Required-by:
=====================================我是分割线===================================
以下是2018/09/14 09:29存的草稿,本篇记录并完善该草稿于2019/02/27
有一天逛知乎的时候, 首页被推送了这样一个问题:
由于之前看廖雪峰老师的python3教程, 了解了一些python基础语法知识. 然后又看了崔庆才老师的网络爬虫的书. 于是就想着用py3 将这个答案下的图片全部爬取下来, 这个答案下可是有六千多个回答呢
第一次用python实践现学现用 . 有些兴奋
这里把过程记录一下.
python3的安装就不说了.
首先打开浏览器在知乎搜索"你见过最漂亮的女生长什么样", 如果你没有知乎的账号, 可以直接在百度或者google上搜同样的关键字, 然后找到知乎点击进去 就是未登陆的状态也可以浏览这个问题下的答案了. 这里直接附上知乎链接:https://www.zhihu.com/question/34243513/answer/110939108
##########################split#####################################
简单说一下思路:
- 找到加载答案数据的请求;
- 分析请求链接中的参数;
- 根据不同的参数循环发送请求获取响应
- 从响应对象中取到图片的url地址
- 根据rul地址用python以二进制的方式写入到本地磁盘
一 , 找到加载答案数据的请求
我们进入这个问题下 , F12打开控制台, 看network那一栏, 发现又很多请求, 我找了很久才找到我想要的那一个请求, 后来找出了规律, 你只要看众多请求中size最大的那一个, 十有八九是加载这些答案数据的请求. 如下图:
点击我们找的请求, 右边找到"Request URL:" 这就是请求的完整地址了 , 如下图所示:
这个地方我之前犯了一个错误, 我直接爬取的链接是https://www.zhihu.com/question/34243513/answer/110939108, 它响应的只有第一页数据, 之后的翻页什么的参数都没有 (+_+)?
所以不是所有的网站的数据都是直接取浏览器地址栏中的链接. 大部分数据是ajax异步请求来的.
二 , 分析请求链接中的参数
接下来我们分析参数, 我们找到的链接如下:
这里有很多参数, 那么我们只看几个加粗着色的重要的参数就好了. 三个参数
- limit: 看参数名字应该是一页中显示的数据条数
- offset: 看名字可以判断是页面的偏移量
- sort_by: 看名字是排序方式无疑了
这有一个细节, 当你第一次进入这个页面的时候 limit是 3 也就是说, 只展示3条数据, 当你点击类似于"加载更多" 的按钮的时候, limit和offset的值才会改变成5 . 知乎那个按钮大概长这样的:
没错, 还有最后一个要讲的参数叫 "sort_by" . 看名字自然是知道作用是根据啥啥啥排序. 可以看到它有个默认值就 "default ". 也就是默认排序. 作为一个知乎老透明er, 我当然注意到了知乎每个问题下的右上角有一个"默认排序"的点击操作, 值有二. 如图:
排序参数值"default" 自然就对应的是 "默认排序"也就是按赞数降序, 我点击按时间排序, 发现是按日期降序.同一日期中按时间的时分降序 . 如果你看够了赞数高的那些图片,想看最新发布的内容 那么你只需要改一下"sort_by" 这个参数就ok了 , 如图 , 按时间排序的参数值是"created"
=======================================
url和参数都确认之后设置好请求头, 试着用requests 发一条请求并转成json数据
url = 'https://www.zhihu.com/api/v4/questions/34243513/answers?include=data%5B%2A%5D.is_normal%2Cadmin_closed_comment%2Creward_info%2Cis_collapsed%2Cannotation_action%2Cannotation_detail%2Ccollapse_reason%2Cis_sticky%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2Ccan_comment%2Ccontent%2Ceditable_content%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Ccreated_time%2Cupdated_time%2Creview_info%2Crelevant_info%2Cquestion%2Cexcerpt%2Crelationship.is_authorized%2Cis_author%2Cvoting%2Cis_thanked%2Cis_nothelp%2Cis_labeled%3Bdata%5B%2A%5D.mark_infos%5B%2A%5D.url%3Bdata%5B%2A%5D.author.follower_count%2Cbadge%5B%2A%5D.topics&limit=5&offset=' + str(
offset) + '&platform=desktop&sort_by=' + sort
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36',
'cookie': '_zap=d62a474a-43dc-450a-bdcc-cb807357f4ab; _xsrf=3999fea2-0356-42e7-8d2a-ac968d594c86; d_c0="AEDkV8GlCw-PTjUrBeB6hDjqwntD_bakBL8=|1551259687";q_c1=7d117a8c0f564a3ea2a20d02f83e3bb1|1551259688000|1551259688000; tgw_l7_route=66cb16bc7f45da64562a077714739c11'
}
res = requests.get(url, headers=headers).text
data = json.loads(res)
接下来就分两个步骤就好了, 第一步是解析data这个json格式的数据找到图片链接,第二步就是下载这个图片
data用json.loads转成json之后里面其实全是单引号这样在json.cn里面是无法格式化的,用pyCharm很容易就可以把它所有单引号改成双引号,
首先来解析一下请求到的data数据为了更清晰的查看并将它格式化一下,如图:
放一份完整的json数据如下
{
"data": [
{
"id": 608243858,
"type": "answer",
"answer_type": "normal",
"question": {
"type": "question",
"id": 34243513,
"title": "你见过最漂亮的女生长什么样?",
"question_type": "normal",
"created": 1438930419,
"updated_time": 1508210095,
"url": "https://www.zhihu.com/api/v4/questions/34243513",
"relationship": {}
},
"author": {
"id": "53913d4b615d9b7e57a1a2a9a5088ec1",
"url_token": "475203",
"name": "铛铛",
"avatar_url": "https://pic4.zhimg.com/da8e974dc_is.jpg",
"avatar_url_template": "https://pic4.zhimg.com/da8e974dc_{size}.jpg",
"is_org": "False",
"type": "people",
"url": "https://www.zhihu.com/api/v4/people/53913d4b615d9b7e57a1a2a9a5088ec1",
"user_type": "people",
"headline": "",
"badge": [],
"gender": 0,
"is_advertiser": "False",
"follower_count": 0,
"is_followed": "False",
"is_privacy": "False"
},
"url": "https://www.zhihu.com/api/v4/answers/608243858",
"is_collapsed": "False",
"created_time": 1551103483,
"updated_time": 1551103493,
"extras": "",
"is_copyable": "True",
"is_normal": "True",
"voteup_count": 0,
"comment_count": 0,
"is_sticky": "False",
"admin_closed_comment": "False",
"comment_permission": "all",
"can_comment": {
"reason": "",
"status": "True"
},
"reshipment_settings": "allowed",
"content": "<p>应该是第一次回答吧,不喜绕道,不接受难听的负面评价,因为她是我妹啊~</p><p>纯天然,哪都没动过,她妈妈我婶婶年轻时候更美,超美~</p><p>我手机里她的照片不多,但是我觉得她本人不说更好看,但有更多种好看的样子。</p><p>四大邪术,还是用了滤镜</p><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-a343fcaab25a8be74991d40baa4d43dc_b.jpg\" data-rawwidth=\"1368\" data-rawheight=\"1078\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-3350350c934424a92c0c002d3686eaca_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1368\" data-original=\"https://pic1.zhimg.com/v2-a343fcaab25a8be74991d40baa4d43dc_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1368'%20height='1078'></svg>\" data-rawwidth=\"1368\" data-rawheight=\"1078\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-3350350c934424a92c0c002d3686eaca_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1368\" data-original=\"https://pic1.zhimg.com/v2-a343fcaab25a8be74991d40baa4d43dc_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-a343fcaab25a8be74991d40baa4d43dc_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-36cdb187be4a1e40dc9a5404e3afce21_b.jpg\" data-rawwidth=\"966\" data-rawheight=\"808\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-292285a97976c8a42349c127a1b6d105_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"966\" data-original=\"https://pic2.zhimg.com/v2-36cdb187be4a1e40dc9a5404e3afce21_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='966'%20height='808'></svg>\" data-rawwidth=\"966\" data-rawheight=\"808\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-292285a97976c8a42349c127a1b6d105_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"966\" data-original=\"https://pic2.zhimg.com/v2-36cdb187be4a1e40dc9a5404e3afce21_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-36cdb187be4a1e40dc9a5404e3afce21_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-b51b47882267ca76ea9e36a89597ce27_b.jpg\" data-rawwidth=\"2048\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-e6fa357709a913ce67e6a07438c6285e_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"2048\" data-original=\"https://pic4.zhimg.com/v2-b51b47882267ca76ea9e36a89597ce27_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='2048'%20height='2048'></svg>\" data-rawwidth=\"2048\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-e6fa357709a913ce67e6a07438c6285e_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"2048\" data-original=\"https://pic4.zhimg.com/v2-b51b47882267ca76ea9e36a89597ce27_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-b51b47882267ca76ea9e36a89597ce27_b.jpg\"></figure><p></p>",
"editable_content": "",
"excerpt": "应该是第一次回答吧,不喜绕道,不接受难听的负面评价,因为她是我妹啊~纯天然,哪都没动过,她妈妈我婶婶年轻时候更美,超美~我手机里她的照片不多,但是我觉得她本人不说更好看,但有更多种好看的样子。四大邪术,还是用了滤镜 ",
"collapsed_by": "nobody",
"collapse_reason": "",
"annotation_action": [],
"mark_infos": [],
"relevant_info": {
"is_relevant": "False",
"relevant_type": "",
"relevant_text": ""
},
"suggest_edit": {
"reason": "",
"status": "False",
"tip": "",
"title": "",
"unnormal_details": {
"status": "",
"description": "",
"reason": "",
"reason_id": 0,
"note": ""
},
"url": ""
},
"is_labeled": "False",
"reward_info": {
"can_open_reward": "False",
"is_rewardable": "False",
"reward_member_count": 0,
"reward_total_money": 0,
"tagline": ""
},
"relationship": {
"is_author": "False",
"is_authorized": "False",
"is_nothelp": "False",
"is_thanked": "False",
"voting": 0,
"upvoted_followees": []
}
},
{
"id": 608062810,
"type": "answer",
"answer_type": "normal",
"question": {
"type": "question",
"id": 34243513,
"title": "你见过最漂亮的女生长什么样?",
"question_type": "normal",
"created": 1438930419,
"updated_time": 1508210095,
"url": "https://www.zhihu.com/api/v4/questions/34243513",
"relationship": {}
},
"author": {
"id": "acdca222c15c201469fa6d5e09c8ec01",
"url_token": "heck-96",
"name": "大演说家",
"avatar_url": "https://pic2.zhimg.com/v2-e6274a52c7dd8f576ad5259115cdf604_is.jpg",
"avatar_url_template": "https://pic2.zhimg.com/v2-e6274a52c7dd8f576ad5259115cdf604_{size}.jpg",
"is_org": "False",
"type": "people",
"url": "https://www.zhihu.com/api/v4/people/acdca222c15c201469fa6d5e09c8ec01",
"user_type": "people",
"headline": "FAE",
"badge": [],
"gender": 1,
"is_advertiser": "False",
"follower_count": 2,
"is_followed": "False",
"is_privacy": "False"
},
"url": "https://www.zhihu.com/api/v4/answers/608062810",
"is_collapsed": "False",
"created_time": 1551088503,
"updated_time": 1551088515,
"extras": "",
"is_copyable": "True",
"is_normal": "True",
"voteup_count": 0,
"comment_count": 0,
"is_sticky": "False",
"admin_closed_comment": "False",
"comment_permission": "all",
"can_comment": {
"reason": "",
"status": "True"
},
"reshipment_settings": "allowed",
"content": "<p>这是我见过最好看的女的,没有之一</p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-7f1140de3a46dba6b3c2d228bc425d91_b.jpg\" data-rawwidth=\"1048\" data-rawheight=\"1217\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-53862132bad34f00f2e28999f40858e3_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1048\" data-original=\"https://pic2.zhimg.com/v2-7f1140de3a46dba6b3c2d228bc425d91_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1048'%20height='1217'></svg>\" data-rawwidth=\"1048\" data-rawheight=\"1217\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-53862132bad34f00f2e28999f40858e3_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1048\" data-original=\"https://pic2.zhimg.com/v2-7f1140de3a46dba6b3c2d228bc425d91_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-7f1140de3a46dba6b3c2d228bc425d91_b.jpg\"></figure><p></p>",
"editable_content": "",
"excerpt": "这是我见过最好看的女的,没有之一",
"collapsed_by": "nobody",
"collapse_reason": "",
"annotation_action": [],
"mark_infos": [],
"relevant_info": {
"is_relevant": "False",
"relevant_type": "",
"relevant_text": ""
},
"suggest_edit": {
"reason": "",
"status": "False",
"tip": "",
"title": "",
"unnormal_details": {
"status": "",
"description": "",
"reason": "",
"reason_id": 0,
"note": ""
},
"url": ""
},
"is_labeled": "False",
"reward_info": {
"can_open_reward": "False",
"is_rewardable": "False",
"reward_member_count": 0,
"reward_total_money": 0,
"tagline": ""
},
"relationship": {
"is_author": "False",
"is_authorized": "False",
"is_nothelp": "False",
"is_thanked": "False",
"voting": 0,
"upvoted_followees": []
}
},
{
"id": 607635090,
"type": "answer",
"answer_type": "normal",
"question": {
"type": "question",
"id": 34243513,
"title": "你见过最漂亮的女生长什么样?",
"question_type": "normal",
"created": 1438930419,
"updated_time": 1508210095,
"url": "https://www.zhihu.com/api/v4/questions/34243513",
"relationship": {}
},
"author": {
"id": "7cec8189ce0617bf66915bd7075c3c2a",
"url_token": "gwebuehyo",
"name": "GweBuehyo",
"avatar_url": "https://pic4.zhimg.com/v2-1f904e8ce52987d90cd110ce10594352_is.jpg",
"avatar_url_template": "https://pic4.zhimg.com/v2-1f904e8ce52987d90cd110ce10594352_{size}.jpg",
"is_org": "False",
"type": "people",
"url": "https://www.zhihu.com/api/v4/people/7cec8189ce0617bf66915bd7075c3c2a",
"user_type": "people",
"headline": "",
"badge": [],
"gender": 1,
"is_advertiser": "False",
"follower_count": 0,
"is_followed": "False",
"is_privacy": "False"
},
"url": "https://www.zhihu.com/api/v4/answers/607635090",
"is_collapsed": "False",
"created_time": 1551058547,
"updated_time": 1551058547,
"extras": "",
"is_copyable": "True",
"is_normal": "True",
"voteup_count": 0,
"comment_count": 0,
"is_sticky": "False",
"admin_closed_comment": "False",
"comment_permission": "all",
"can_comment": {
"reason": "",
"status": "True"
},
"reshipment_settings": "allowed",
"content": "<p>我这辈子见过最好看的,是一个路人。话不多说,上图</p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-f1929b9b75698d1d94e2c678b61ac751_b.jpg\" data-rawwidth=\"1080\" data-rawheight=\"2160\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-26ba7ce96cac43afd5546ed685065870_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1080\" data-original=\"https://pic2.zhimg.com/v2-f1929b9b75698d1d94e2c678b61ac751_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1080'%20height='2160'></svg>\" data-rawwidth=\"1080\" data-rawheight=\"2160\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-26ba7ce96cac43afd5546ed685065870_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1080\" data-original=\"https://pic2.zhimg.com/v2-f1929b9b75698d1d94e2c678b61ac751_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-f1929b9b75698d1d94e2c678b61ac751_b.jpg\"></figure><p>有些人一辈子只能见一面,555555</p>",
"editable_content": "",
"excerpt": "我这辈子见过最好看的,是一个路人。话不多说,上图有些人一辈子只能见一面,555555",
"collapsed_by": "nobody",
"collapse_reason": "",
"annotation_action": [],
"mark_infos": [],
"relevant_info": {
"is_relevant": "False",
"relevant_type": "",
"relevant_text": ""
},
"suggest_edit": {
"reason": "",
"status": "False",
"tip": "",
"title": "",
"unnormal_details": {
"status": "",
"description": "",
"reason": "",
"reason_id": 0,
"note": ""
},
"url": ""
},
"is_labeled": "False",
"reward_info": {
"can_open_reward": "False",
"is_rewardable": "False",
"reward_member_count": 0,
"reward_total_money": 0,
"tagline": ""
},
"relationship": {
"is_author": "False",
"is_authorized": "False",
"is_nothelp": "False",
"is_thanked": "False",
"voting": 0,
"upvoted_followees": []
}
},
{
"id": 574208958,
"type": "answer",
"answer_type": "normal",
"question": {
"type": "question",
"id": 34243513,
"title": "你见过最漂亮的女生长什么样?",
"question_type": "normal",
"created": 1438930419,
"updated_time": 1508210095,
"url": "https://www.zhihu.com/api/v4/questions/34243513",
"relationship": {}
},
"author": {
"id": "0",
"url_token": "",
"name": "匿名用户",
"avatar_url": "https://pic1.zhimg.com/aadd7b895_is.jpg",
"avatar_url_template": "https://pic1.zhimg.com/aadd7b895_{size}.jpg",
"is_org": "False",
"type": "people",
"url": "https://www.zhihu.com/api/v4/people/0",
"user_type": "people",
"headline": "",
"badge": [],
"gender": 1,
"is_advertiser": "False",
"follower_count": 0,
"is_following": "False",
"is_followed": "False",
"is_celebrity": "False",
"is_blocking": "False",
"is_blocked": "False",
"is_privacy": "False"
},
"url": "https://www.zhihu.com/api/v4/answers/574208958",
"is_collapsed": "False",
"created_time": 1547523070,
"updated_time": 1551019993,
"extras": "",
"is_copyable": "True",
"is_normal": "True",
"voteup_count": 0,
"comment_count": 0,
"is_sticky": "False",
"admin_closed_comment": "False",
"comment_permission": "all",
"can_comment": {
"reason": "",
"status": "True"
},
"reshipment_settings": "allowed",
"content": "<p>超喜欢她,一个朋友</p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-032f0ad4cee835bd53e83cb254e9e5b1_b.jpg\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-5de9a129c2283916b18b96ae444d0e49_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"2048\" data-original=\"https://pic2.zhimg.com/v2-032f0ad4cee835bd53e83cb254e9e5b1_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='2048'%20height='1365'></svg>\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-5de9a129c2283916b18b96ae444d0e49_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"2048\" data-original=\"https://pic2.zhimg.com/v2-032f0ad4cee835bd53e83cb254e9e5b1_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-032f0ad4cee835bd53e83cb254e9e5b1_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-9a486fe35ac583fc7062ba2f6f268f80_b.jpg\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-07a0e114e9561b522d12a77c92db179c_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"2048\" data-original=\"https://pic1.zhimg.com/v2-9a486fe35ac583fc7062ba2f6f268f80_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='2048'%20height='1365'></svg>\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-07a0e114e9561b522d12a77c92db179c_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"2048\" data-original=\"https://pic1.zhimg.com/v2-9a486fe35ac583fc7062ba2f6f268f80_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-9a486fe35ac583fc7062ba2f6f268f80_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-c26dc8483495d60723fd8ee4729451d0_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-7e51bf3995a4898d10509f0ea2f4a2cf_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic1.zhimg.com/v2-c26dc8483495d60723fd8ee4729451d0_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-7e51bf3995a4898d10509f0ea2f4a2cf_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic1.zhimg.com/v2-c26dc8483495d60723fd8ee4729451d0_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-c26dc8483495d60723fd8ee4729451d0_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-af24df84e0b8a91cf0230bc6f714888d_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-0a8f2f572d16681e30254a88a22c2a8d_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic2.zhimg.com/v2-af24df84e0b8a91cf0230bc6f714888d_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-0a8f2f572d16681e30254a88a22c2a8d_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic2.zhimg.com/v2-af24df84e0b8a91cf0230bc6f714888d_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-af24df84e0b8a91cf0230bc6f714888d_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-00b60270e14032e03b36cf0d6f529d69_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-05dbfa1e0e99489c009b9395e1f7814d_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic2.zhimg.com/v2-00b60270e14032e03b36cf0d6f529d69_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-05dbfa1e0e99489c009b9395e1f7814d_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic2.zhimg.com/v2-00b60270e14032e03b36cf0d6f529d69_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-00b60270e14032e03b36cf0d6f529d69_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-09e2cf3bae12f8717207b2d34d37f3f3_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-82e800bc4ce91a34b0ba76a6dc37dc0c_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic4.zhimg.com/v2-09e2cf3bae12f8717207b2d34d37f3f3_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-82e800bc4ce91a34b0ba76a6dc37dc0c_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic4.zhimg.com/v2-09e2cf3bae12f8717207b2d34d37f3f3_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-09e2cf3bae12f8717207b2d34d37f3f3_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-69a6fc795e0bf504a8e837a1712cb497_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-548de7c28a4625f93d0a46feb852cd6a_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic4.zhimg.com/v2-69a6fc795e0bf504a8e837a1712cb497_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-548de7c28a4625f93d0a46feb852cd6a_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic4.zhimg.com/v2-69a6fc795e0bf504a8e837a1712cb497_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-69a6fc795e0bf504a8e837a1712cb497_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-967b176e483be758565e370606893aa5_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-29d38a37979b79c003ca59dac254a5f8_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic2.zhimg.com/v2-967b176e483be758565e370606893aa5_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-29d38a37979b79c003ca59dac254a5f8_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic2.zhimg.com/v2-967b176e483be758565e370606893aa5_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-967b176e483be758565e370606893aa5_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-780e66e993c17464274d1f53bc25467b_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-59def168028aeab392aef2479016f595_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic4.zhimg.com/v2-780e66e993c17464274d1f53bc25467b_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-59def168028aeab392aef2479016f595_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic4.zhimg.com/v2-780e66e993c17464274d1f53bc25467b_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-780e66e993c17464274d1f53bc25467b_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-bba42ce16ff24dd7cfbe3e537626ffc8_b.jpg\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-3519480ceacf643985c5026acd911e7f_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"2048\" data-original=\"https://pic1.zhimg.com/v2-bba42ce16ff24dd7cfbe3e537626ffc8_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='2048'%20height='1365'></svg>\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-3519480ceacf643985c5026acd911e7f_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"2048\" data-original=\"https://pic1.zhimg.com/v2-bba42ce16ff24dd7cfbe3e537626ffc8_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-bba42ce16ff24dd7cfbe3e537626ffc8_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-7929b4c75af441985ee90634a8cbee56_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-cd3253b385017e1487a30a93b223efe9_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic3.zhimg.com/v2-7929b4c75af441985ee90634a8cbee56_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-cd3253b385017e1487a30a93b223efe9_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic3.zhimg.com/v2-7929b4c75af441985ee90634a8cbee56_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-7929b4c75af441985ee90634a8cbee56_b.jpg\"></figure><p><br></p><hr><p>我的女神,爱死了</p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-266c0986d4f6cfb95ed94e67e2a3deef_b.jpg\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-aa69b797d352cb388899a389e609eec9_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"2048\" data-original=\"https://pic4.zhimg.com/v2-266c0986d4f6cfb95ed94e67e2a3deef_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='2048'%20height='1365'></svg>\" data-rawwidth=\"2048\" data-rawheight=\"1365\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-aa69b797d352cb388899a389e609eec9_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"2048\" data-original=\"https://pic4.zhimg.com/v2-266c0986d4f6cfb95ed94e67e2a3deef_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-266c0986d4f6cfb95ed94e67e2a3deef_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-3f4f07c44ed351410c0ef30021ad1fa6_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-55401a9344c127b9c714a0f77632f62c_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic3.zhimg.com/v2-3f4f07c44ed351410c0ef30021ad1fa6_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-55401a9344c127b9c714a0f77632f62c_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic3.zhimg.com/v2-3f4f07c44ed351410c0ef30021ad1fa6_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-3f4f07c44ed351410c0ef30021ad1fa6_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-3e54d4bd7e83f0c1db45aabd537b8860_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-34e1c180239f42c550d7e6132542be68_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic1.zhimg.com/v2-3e54d4bd7e83f0c1db45aabd537b8860_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-34e1c180239f42c550d7e6132542be68_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic1.zhimg.com/v2-3e54d4bd7e83f0c1db45aabd537b8860_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-3e54d4bd7e83f0c1db45aabd537b8860_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-2db9bc1e27cf61a23e3b3e0e5277938c_b.jpg\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-cee1e0b887a29d5ef9d196ac3213224a_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1365\" data-original=\"https://pic1.zhimg.com/v2-2db9bc1e27cf61a23e3b3e0e5277938c_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1365'%20height='2048'></svg>\" data-rawwidth=\"1365\" data-rawheight=\"2048\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-cee1e0b887a29d5ef9d196ac3213224a_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1365\" data-original=\"https://pic1.zhimg.com/v2-2db9bc1e27cf61a23e3b3e0e5277938c_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-2db9bc1e27cf61a23e3b3e0e5277938c_b.jpg\"></figure><p><br></p><hr><p>奈何已深陷</p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-66416bbbb2672bba5b9777a1356ba6b1_b.jpg\" data-rawwidth=\"720\" data-rawheight=\"1280\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-f7d06daea7270a877db7ea764b4383ef_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"720\" data-original=\"https://pic2.zhimg.com/v2-66416bbbb2672bba5b9777a1356ba6b1_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='720'%20height='1280'></svg>\" data-rawwidth=\"720\" data-rawheight=\"1280\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-f7d06daea7270a877db7ea764b4383ef_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"720\" data-original=\"https://pic2.zhimg.com/v2-66416bbbb2672bba5b9777a1356ba6b1_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-66416bbbb2672bba5b9777a1356ba6b1_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-7b30886d7242da8ce848b7d89219bfe0_b.jpg\" data-rawwidth=\"960\" data-rawheight=\"1280\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-69aab67cd88379b4fc81d23050d3202b_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"960\" data-original=\"https://pic1.zhimg.com/v2-7b30886d7242da8ce848b7d89219bfe0_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='960'%20height='1280'></svg>\" data-rawwidth=\"960\" data-rawheight=\"1280\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-69aab67cd88379b4fc81d23050d3202b_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"960\" data-original=\"https://pic1.zhimg.com/v2-7b30886d7242da8ce848b7d89219bfe0_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-7b30886d7242da8ce848b7d89219bfe0_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-5480ba218417a1e8f3d2dd8b68fadc86_b.jpg\" data-rawwidth=\"1200\" data-rawheight=\"1600\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-96b96a88521ed83530551a26b479ff50_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1200\" data-original=\"https://pic3.zhimg.com/v2-5480ba218417a1e8f3d2dd8b68fadc86_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1200'%20height='1600'></svg>\" data-rawwidth=\"1200\" data-rawheight=\"1600\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-96b96a88521ed83530551a26b479ff50_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1200\" data-original=\"https://pic3.zhimg.com/v2-5480ba218417a1e8f3d2dd8b68fadc86_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-5480ba218417a1e8f3d2dd8b68fadc86_b.jpg\"></figure><p><br></p><hr><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-bc8078333f7892672c1ae66545e70e36_b.jpg\" data-rawwidth=\"640\" data-rawheight=\"851\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-bc43426ebac4cff002710726b1ce6d45_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"640\" data-original=\"https://pic3.zhimg.com/v2-bc8078333f7892672c1ae66545e70e36_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='640'%20height='851'></svg>\" data-rawwidth=\"640\" data-rawheight=\"851\" data-size=\"normal\" data-default-watermark-src=\"https://pic2.zhimg.com/v2-bc43426ebac4cff002710726b1ce6d45_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"640\" data-original=\"https://pic3.zhimg.com/v2-bc8078333f7892672c1ae66545e70e36_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-bc8078333f7892672c1ae66545e70e36_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-d136a61ddcf0756a2de22a97c9ff8892_b.jpg\" data-rawwidth=\"1200\" data-rawheight=\"1600\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-7e71ce063e19ce6fe7b3a3448d89af80_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"1200\" data-original=\"https://pic3.zhimg.com/v2-d136a61ddcf0756a2de22a97c9ff8892_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1200'%20height='1600'></svg>\" data-rawwidth=\"1200\" data-rawheight=\"1600\" data-size=\"normal\" data-default-watermark-src=\"https://pic1.zhimg.com/v2-7e71ce063e19ce6fe7b3a3448d89af80_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1200\" data-original=\"https://pic3.zhimg.com/v2-d136a61ddcf0756a2de22a97c9ff8892_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-d136a61ddcf0756a2de22a97c9ff8892_b.jpg\"></figure><p>好害羞~</p><hr><p>就应该是没有在一起的可能吧</p>",
"editable_content": "",
"excerpt": "超喜欢她,一个朋友 我的女神,爱死了 奈何已深陷 好害羞~就应该是没有在一起的可能吧",
"collapsed_by": "nobody",
"collapse_reason": "",
"annotation_action": [],
"mark_infos": [],
"relevant_info": {
"is_relevant": "False",
"relevant_type": "",
"relevant_text": ""
},
"suggest_edit": {
"reason": "",
"status": "False",
"tip": "",
"title": "",
"unnormal_details": {
"status": "",
"description": "",
"reason": "",
"reason_id": 0,
"note": ""
},
"url": ""
},
"is_labeled": "False",
"reward_info": {
"can_open_reward": "False",
"is_rewardable": "False",
"reward_member_count": 0,
"reward_total_money": 0,
"tagline": ""
},
"relationship": {
"is_author": "False",
"is_authorized": "False",
"is_nothelp": "False",
"is_thanked": "False",
"voting": 0,
"upvoted_followees": []
}
},
{
"id": 289133817,
"type": "answer",
"answer_type": "normal",
"question": {
"type": "question",
"id": 34243513,
"title": "你见过最漂亮的女生长什么样?",
"question_type": "normal",
"created": 1438930419,
"updated_time": 1508210095,
"url": "https://www.zhihu.com/api/v4/questions/34243513",
"relationship": {}
},
"author": {
"id": "b77a087c065c67f376e84b0e4f59b478",
"url_token": "yimei-huo-po-de-luo-xuan",
"name": "Sponge",
"avatar_url": "https://pic1.zhimg.com/v2-8e111664b38dd0897d8ec6bed6fb4c7c_is.jpg",
"avatar_url_template": "https://pic1.zhimg.com/v2-8e111664b38dd0897d8ec6bed6fb4c7c_{size}.jpg",
"is_org": "False",
"type": "people",
"url": "https://www.zhihu.com/api/v4/people/b77a087c065c67f376e84b0e4f59b478",
"user_type": "people",
"headline": "请善用语言 使人言可敬\n正在追求马先生笔下的自由",
"badge": [],
"gender": 0,
"is_advertiser": "False",
"follower_count": 9,
"is_followed": "False",
"is_privacy": "False"
},
"url": "https://www.zhihu.com/api/v4/answers/289133817",
"is_collapsed": "False",
"created_time": 1515060176,
"updated_time": 1551000513,
"extras": "",
"is_copyable": "True",
"is_normal": "True",
"voteup_count": 0,
"comment_count": 0,
"is_sticky": "False",
"admin_closed_comment": "False",
"comment_permission": "all",
"can_comment": {
"reason": "",
"status": "True"
},
"reshipment_settings": "allowed",
"content": "<p>再次补充</p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-ebec43fd2561a038acd0ff595bb3c525_b.jpg\" data-rawwidth=\"960\" data-rawheight=\"944\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-b6ba8d3f3ebb2ea8d8fb4d5734a84536_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"960\" data-original=\"https://pic2.zhimg.com/v2-ebec43fd2561a038acd0ff595bb3c525_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='960'%20height='944'></svg>\" data-rawwidth=\"960\" data-rawheight=\"944\" data-size=\"normal\" data-default-watermark-src=\"https://pic3.zhimg.com/v2-b6ba8d3f3ebb2ea8d8fb4d5734a84536_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"960\" data-original=\"https://pic2.zhimg.com/v2-ebec43fd2561a038acd0ff595bb3c525_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-ebec43fd2561a038acd0ff595bb3c525_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-b046bbdbf14b9594d65055f98d7b9658_b.jpg\" data-rawwidth=\"960\" data-rawheight=\"947\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-74e7b650b60d71105e9ec46219e50ee7_b.jpg\" class=\"origin_image zh-lightbox-thumb\" width=\"960\" data-original=\"https://pic1.zhimg.com/v2-b046bbdbf14b9594d65055f98d7b9658_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='960'%20height='947'></svg>\" data-rawwidth=\"960\" data-rawheight=\"947\" data-size=\"normal\" data-default-watermark-src=\"https://pic4.zhimg.com/v2-74e7b650b60d71105e9ec46219e50ee7_b.jpg\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"960\" data-original=\"https://pic1.zhimg.com/v2-b046bbdbf14b9594d65055f98d7b9658_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-b046bbdbf14b9594d65055f98d7b9658_b.jpg\"></figure><p>补充回答<br>又得到了喜欢的颜的照片</p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-88955fda0df6bcba7291157e31c03909_b.gif\" data-rawwidth=\"400\" data-rawheight=\"225\" data-size=\"normal\" data-thumbnail=\"https://pic2.zhimg.com/v2-88955fda0df6bcba7291157e31c03909_b.jpg\" class=\"content_image\" width=\"400\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='400'%20height='225'></svg>\" data-rawwidth=\"400\" data-rawheight=\"225\" data-size=\"normal\" data-thumbnail=\"https://pic2.zhimg.com/v2-88955fda0df6bcba7291157e31c03909_b.jpg\" class=\"content_image lazy\" width=\"400\" data-actualsrc=\"https://pic2.zhimg.com/v2-88955fda0df6bcba7291157e31c03909_b.gif\"></figure><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-787f4e82cbd70ae2db118e72913f9cc3_b.jpg\" data-rawwidth=\"720\" data-rawheight=\"960\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"720\" data-original=\"https://pic4.zhimg.com/v2-787f4e82cbd70ae2db118e72913f9cc3_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='720'%20height='960'></svg>\" data-rawwidth=\"720\" data-rawheight=\"960\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"720\" data-original=\"https://pic4.zhimg.com/v2-787f4e82cbd70ae2db118e72913f9cc3_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-787f4e82cbd70ae2db118e72913f9cc3_b.jpg\"></figure><p><br></p><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-b56e3686f4daa2b8e03d9658ce50d22b_b.jpg\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"1080\" data-original=\"https://pic4.zhimg.com/v2-b56e3686f4daa2b8e03d9658ce50d22b_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1080'%20height='1920'></svg>\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1080\" data-original=\"https://pic4.zhimg.com/v2-b56e3686f4daa2b8e03d9658ce50d22b_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-b56e3686f4daa2b8e03d9658ce50d22b_b.jpg\"></figure><p><br></p><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-01e3be7294c60dbe51fda6623eafe430_b.jpg\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"1080\" data-original=\"https://pic1.zhimg.com/v2-01e3be7294c60dbe51fda6623eafe430_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1080'%20height='1920'></svg>\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1080\" data-original=\"https://pic1.zhimg.com/v2-01e3be7294c60dbe51fda6623eafe430_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-01e3be7294c60dbe51fda6623eafe430_b.jpg\"></figure><p><br></p><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-30f455ce90cde4d83424813925a78fba_b.jpg\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"1080\" data-original=\"https://pic3.zhimg.com/v2-30f455ce90cde4d83424813925a78fba_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1080'%20height='1920'></svg>\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1080\" data-original=\"https://pic3.zhimg.com/v2-30f455ce90cde4d83424813925a78fba_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-30f455ce90cde4d83424813925a78fba_b.jpg\"></figure><p><br></p><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-4d18595f703a5ef98ee16ec872c33d28_b.jpg\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"1080\" data-original=\"https://pic1.zhimg.com/v2-4d18595f703a5ef98ee16ec872c33d28_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='1080'%20height='1920'></svg>\" data-rawwidth=\"1080\" data-rawheight=\"1920\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"1080\" data-original=\"https://pic1.zhimg.com/v2-4d18595f703a5ef98ee16ec872c33d28_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-4d18595f703a5ef98ee16ec872c33d28_b.jpg\"></figure><p><br>其实不止一个...有习惯收美好照片激励自己,不止女生也有男生emmm...</p><p><br></p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-7f2e4a1a6c75988c3756c90498b818f5_b.jpg\" data-rawwidth=\"590\" data-rawheight=\"748\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"590\" data-original=\"https://pic2.zhimg.com/v2-7f2e4a1a6c75988c3756c90498b818f5_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='590'%20height='748'></svg>\" data-rawwidth=\"590\" data-rawheight=\"748\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"590\" data-original=\"https://pic2.zhimg.com/v2-7f2e4a1a6c75988c3756c90498b818f5_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-7f2e4a1a6c75988c3756c90498b818f5_b.jpg\"></figure><p><br></p><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-7891c0130f7ce4ea595b48433081e173_b.jpg\" data-rawwidth=\"960\" data-rawheight=\"960\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"960\" data-original=\"https://pic4.zhimg.com/v2-7891c0130f7ce4ea595b48433081e173_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='960'%20height='960'></svg>\" data-rawwidth=\"960\" data-rawheight=\"960\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"960\" data-original=\"https://pic4.zhimg.com/v2-7891c0130f7ce4ea595b48433081e173_r.jpg\" data-actualsrc=\"https://pic4.zhimg.com/v2-7891c0130f7ce4ea595b48433081e173_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic2.zhimg.com/v2-f514ce184346c1b18a8a905f3c282e8d_b.jpg\" data-rawwidth=\"640\" data-rawheight=\"4459\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"640\" data-original=\"https://pic2.zhimg.com/v2-f514ce184346c1b18a8a905f3c282e8d_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='640'%20height='4459'></svg>\" data-rawwidth=\"640\" data-rawheight=\"4459\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"640\" data-original=\"https://pic2.zhimg.com/v2-f514ce184346c1b18a8a905f3c282e8d_r.jpg\" data-actualsrc=\"https://pic2.zhimg.com/v2-f514ce184346c1b18a8a905f3c282e8d_b.jpg\"></figure><p><br></p><figure><noscript><img src=\"https://pic3.zhimg.com/v2-e47d6d14bb1207d7c3ab71fb8f604ab6_b.jpg\" data-rawwidth=\"640\" data-rawheight=\"384\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"640\" data-original=\"https://pic3.zhimg.com/v2-e47d6d14bb1207d7c3ab71fb8f604ab6_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='640'%20height='384'></svg>\" data-rawwidth=\"640\" data-rawheight=\"384\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"640\" data-original=\"https://pic3.zhimg.com/v2-e47d6d14bb1207d7c3ab71fb8f604ab6_r.jpg\" data-actualsrc=\"https://pic3.zhimg.com/v2-e47d6d14bb1207d7c3ab71fb8f604ab6_b.jpg\"></figure><p>还有很多没水印的没放【除了最后一张太喜欢这个妹子了】再放一张</p><p><br></p><figure><noscript><img src=\"https://pic1.zhimg.com/v2-cef6d8001dd2ea0714512b222b5ca800_b.jpg\" data-rawwidth=\"564\" data-rawheight=\"563\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb\" width=\"564\" data-original=\"https://pic1.zhimg.com/v2-cef6d8001dd2ea0714512b222b5ca800_r.jpg\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='564'%20height='563'></svg>\" data-rawwidth=\"564\" data-rawheight=\"563\" data-size=\"normal\" class=\"origin_image zh-lightbox-thumb lazy\" width=\"564\" data-original=\"https://pic1.zhimg.com/v2-cef6d8001dd2ea0714512b222b5ca800_r.jpg\" data-actualsrc=\"https://pic1.zhimg.com/v2-cef6d8001dd2ea0714512b222b5ca800_b.jpg\"></figure><p>她整个人的个性风格在我看来是最美的</p><p>因为可能偏题了<br>所以我就匿名了<br>怕被骂</p><p><br></p><figure><noscript><img src=\"https://pic4.zhimg.com/v2-cdb29de1ed47b74ca96594a890576bcb_b.jpg\" data-rawwidth=\"295\" data-rawheight=\"295\" data-size=\"normal\" class=\"content_image\" width=\"295\"></noscript><img src=\"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='295'%20height='295'></svg>\" data-rawwidth=\"295\" data-rawheight=\"295\" data-size=\"normal\" class=\"content_image lazy\" width=\"295\" data-actualsrc=\"https://pic4.zhimg.com/v2-cdb29de1ed47b74ca96594a890576bcb_b.jpg\"></figure><p>.....<br>因为匿名了就看不到自己的答案了...<br>所以我又取匿了..恩..骂吧</p><p><br></p><p>....<br>突然想到我可以限制评论啊哈哈哈哈哈哈哈哈哈</p>",
"editable_content": "",
"excerpt": "再次补充 补充回答 又得到了喜欢的颜的照片 其实不止一个...有习惯收美好照片激励自己,不止女生也有男生emmm... 还有很多没水印的没放【除了最后一张太喜欢这个妹子了】再放一张 她整个人的个性风格在我看来是最美的因为可能偏题了 所以我就匿名了 怕被骂 …",
"collapsed_by": "nobody",
"collapse_reason": "",
"annotation_action": [],
"mark_infos": [],
"relevant_info": {
"is_relevant": "False",
"relevant_type": "",
"relevant_text": ""
},
"suggest_edit": {
"reason": "",
"status": "False",
"tip": "",
"title": "",
"unnormal_details": {
"status": "",
"description": "",
"reason": "",
"reason_id": 0,
"note": ""
},
"url": ""
},
"is_labeled": "False",
"reward_info": {
"can_open_reward": "False",
"is_rewardable": "False",
"reward_member_count": 0,
"reward_total_money": 0,
"tagline": ""
},
"relationship": {
"is_author": "False",
"is_authorized": "False",
"is_nothelp": "False",
"is_thanked": "False",
"voting": 0,
"upvoted_followees": []
}
}
],
"paging": {
"is_end": "False",
"is_start": "True",
"next": "https://www.zhihu.com/api/v4/questions/34243513/answers?include=data%5B%2A%5D.is_normal%2Cadmin_closed_comment%2Creward_info%2Cis_collapsed%2Cannotation_action%2Cannotation_detail%2Ccollapse_reason%2Cis_sticky%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2Ccan_comment%2Ccontent%2Ceditable_content%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Ccreated_time%2Cupdated_time%2Creview_info%2Crelevant_info%2Cquestion%2Cexcerpt%2Crelationship.is_authorized%2Cis_author%2Cvoting%2Cis_thanked%2Cis_nothelp%2Cis_labeled%3Bdata%5B%2A%5D.mark_infos%5B%2A%5D.url%3Bdata%5B%2A%5D.author.follower_count%2Cbadge%5B%2A%5D.topics&limit=5&offset=5&platform=desktop&sort_by=updated",
"previous": "https://www.zhihu.com/api/v4/questions/34243513/answers?include=data%5B%2A%5D.is_normal%2Cadmin_closed_comment%2Creward_info%2Cis_collapsed%2Cannotation_action%2Cannotation_detail%2Ccollapse_reason%2Cis_sticky%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2Ccan_comment%2Ccontent%2Ceditable_content%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Ccreated_time%2Cupdated_time%2Creview_info%2Crelevant_info%2Cquestion%2Cexcerpt%2Crelationship.is_authorized%2Cis_author%2Cvoting%2Cis_thanked%2Cis_nothelp%2Cis_labeled%3Bdata%5B%2A%5D.mark_infos%5B%2A%5D.url%3Bdata%5B%2A%5D.author.follower_count%2Cbadge%5B%2A%5D.topics&limit=5&offset=0&platform=desktop&sort_by=updated",
"totals": 7643
}
}
仔细看上面的数据很容易就可以发现知乎的回答的正文其实是在data中的content元素中如下图:
然后我们就可以解析content元素中的内容通过PyQuery来查找img标签并取得img标签的src属性也就是图片链接
picRepo = 'picRepo'
if not os.path.exists(picRepo):
os.makedirs(picRepo)
if data.get("data"):
for i, item in enumerate(data['data']):
content = pq(item['content'])
imgUrls = content.find('noscript img').items()
for imgTag in imgUrls:
src = imgTag.attr("src")
strIndex = src.rfind('.')
suffix = src[strIndex:]
with open(f"{picRepo}/{uuid.uuid4()}{suffix}", 'wb') as f:
f.write(requests.get(src).content)
这样基本上就可以爬取知乎的一页数据了。 如果要爬取多条那么就用循环。
这里我将爬取图片的代码封装了一下,然后放在循环里面传入偏移量和排序方式的参数 如下:
if __name__ == '__main__':
starttime = datetime.datetime.now()
strTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
stime = print(f'开始抓取,当前时间: {strTime}')
for i in range(3): # 知乎偏移量单位是5所以用i*5,这里循环3次,从0开始
start(offset=((i * 5) if i != 0 else 0), sort='updated') # updated:按时间降序,default:默认排序
# 看不了的图片其实返回的是一个400的badRequest的状态码
time.sleep(3)
endtime = datetime.datetime.now()
print(f'抓取完毕,用时 {((endtime - starttime).seconds)} 秒:')
大功告成
以下是爬取的图片数据, 第一次写python,有问题的地方多多指点
完。