From cc5dfc061b9511fbaf04b4e1377adaa51e3b0cc9 Mon Sep 17 00:00:00 2001 From: ReaJason Date: Wed, 20 Sep 2023 22:28:52 +0800 Subject: [PATCH] fix: sign error, resolved ##53 --- example/basic_usage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/basic_usage.py b/example/basic_usage.py index aee4084..704f64d 100644 --- a/example/basic_usage.py +++ b/example/basic_usage.py @@ -22,7 +22,7 @@ def sign(uri, data=None, a1="", web_session=""): browser_context.add_cookies([ {'name': 'a1', 'value': a1, 'domain': ".xiaohongshu.com", 'path': "/"}] ) - + context_page.reload() # 这个地方设置完浏览器 cookie 之后,如果这儿不 sleep 一下签名获取就失败了,如果经常失败请设置长一点试试 sleep(1) encrypt_params = context_page.evaluate("([url, data]) => window._webmsxyw(url, data)", [uri, data])