Commit 27c3403a authored by litaolemo's avatar litaolemo

update

parent 165b4f03
......@@ -88,6 +88,7 @@ class Crawler_xiaohongshu():
prefs = {"profile.managed_default_content_settings.images": 2}
self.chrome_options.add_experimental_option("prefs", prefs)
self.driver = webdriver.Chrome(options=self.chrome_options)
self.driver.add_cookie({'name' : 'timestamp2', 'value' : '2021010899964852bd70ca4c0c991c6c'})
def __exit__(self):
self.driver.close()
......@@ -164,10 +165,10 @@ class Crawler_xiaohongshu():
#
# return True
# print(self.driver.get_log("performance"))
cookie_dic={"timestamp2":"2021010899964852bd70ca4c0c991c6c"}
# for k in cookie:
# cookie_dic[k["name"]] = k["value"]
# print(cookie_dic)
cookie_dic={}
for k in cookie:
cookie_dic[k["name"]] = k["value"]
print(cookie_dic)
headers = {
"host":"www.xiaohongshu.com",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
......
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