Commit 385821df authored by 段英荣's avatar 段英荣

增加搜索爬取功能

parent 0797736e
......@@ -249,6 +249,7 @@ class ZhihuAccount(object):
if "data" in raw_content_dict:
for data_item in raw_content_dict["data"]:
if data_item["type"] == "search_result":
try:
data_type = data_item["object"]["type"]
content = data_item["object"]["content"]
platform_id = data_item["object"]["id"]
......@@ -274,6 +275,8 @@ class ZhihuAccount(object):
}
zhihu_spider_fd.write(json.dumps(item_dict) + "\n")
except:
print(str(data_item))
time.sleep(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment