脚本中只修改了 cokkie,设置了a1,webID,web_session三个参数,有以下报错:
python example/basic_usage.py
Traceback (most recent call last):
File "/Users/echooo/Documents/Code/my_repo/周末计划生成器/xhs/example/basic_usage.py", line 50, in
note_info = xhs_client.get_note_by_id("64c27f08000000001701967a")
File "/opt/homebrew/lib/python3.9/site-packages/xhs/core.py", line 201, in get_note_by_id
res = self.post(uri, data)
File "/opt/homebrew/lib/python3.9/site-packages/xhs/core.py", line 187, in post
self._pre_headers(uri, data, is_creator=is_creator)
File "/opt/homebrew/lib/python3.9/site-packages/xhs/core.py", line 155, in _pre_headers
self.sign(
File "/Users/echooo/Documents/Code/my_repo/周末计划生成器/xhs/example/basic_usage.py", line 31, in sign
encrypt_params = context_page.evaluate(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/sync_api/_generated.py", line 8698, in evaluate
self._sync(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_sync_base.py", line 109, in _sync
return task.result()
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_page.py", line 395, in evaluate
return await self._main_frame.evaluate(expression, arg)
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_frame.py", line 277, in evaluate
await self._channel.send(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 61, in send
return await self._connection.wrap_api_call(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 482, in wrap_api_call
return await cb()
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 97, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.Error: Execution context was destroyed, most likely because of a navigation
脚本中只修改了 cokkie,设置了a1,webID,web_session三个参数,有以下报错: python example/basic_usage.py Traceback (most recent call last): File "/Users/echooo/Documents/Code/my_repo/周末计划生成器/xhs/example/basic_usage.py", line 50, in
note_info = xhs_client.get_note_by_id("64c27f08000000001701967a")
File "/opt/homebrew/lib/python3.9/site-packages/xhs/core.py", line 201, in get_note_by_id
res = self.post(uri, data)
File "/opt/homebrew/lib/python3.9/site-packages/xhs/core.py", line 187, in post
self._pre_headers(uri, data, is_creator=is_creator)
File "/opt/homebrew/lib/python3.9/site-packages/xhs/core.py", line 155, in _pre_headers
self.sign(
File "/Users/echooo/Documents/Code/my_repo/周末计划生成器/xhs/example/basic_usage.py", line 31, in sign
encrypt_params = context_page.evaluate(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/sync_api/_generated.py", line 8698, in evaluate
self._sync(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_sync_base.py", line 109, in _sync
return task.result()
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_page.py", line 395, in evaluate
return await self._main_frame.evaluate(expression, arg)
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_frame.py", line 277, in evaluate
await self._channel.send(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 61, in send
return await self._connection.wrap_api_call(
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 482, in wrap_api_call
return await cb()
File "/opt/homebrew/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 97, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.Error: Execution context was destroyed, most likely because of a navigation