Commit 1d640c63 authored by litaolemo's avatar litaolemo

update

parent 51fd88eb
......@@ -151,6 +151,7 @@ class Crawler_xiaohongshu():
# time.sleep(random.randint(1, 2))
page_text = res.text
print(page_text)
data_list = re.findall("window.__INITIAL_SSR_STATE__=(.*?)</script>", page_text)[0]
data_json = json.loads(data_list)
# # print(data_list)
......@@ -161,7 +162,7 @@ class Crawler_xiaohongshu():
video_dic = {}
page_id = info_dic["id"]
title = info_dic["title"]
desc = info_dic["desc"]
desc = info_dic.get("desc","")
time_ts = datetime.datetime.strptime(info_dic["time"],'%Y-%m-%d %H:%M').timestamp()
if info_dic["type"] != "normal":
continue
......
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