我正在使用notion.py,我刚开始使用python,我想从页面中获得一个页面标题,并将它发布到另一个页面中,但是当我尝试时,我会得到一个错误
Traceback (most recent call last):
File "auto_notion_read.py", line 16, in <module>
page_read = client.get_block(list_url_read)
File "/home/lotfi/.local/lib/python3.6/site-packages/notion/client.py", line 169, in get_block
block = self.get_record_data("block", block_id, force_refresh=force_refresh)
File "/home/lotfi/.local/lib/python3.6/site-packages/notion/client.py", line 162, in get_record_data
return self._store.get(table, id, force_refresh=force_refresh)
File "/home/lotfi/.local/lib/python3.6/site-packages/notion/store.py", line 184, in get
self.call_load_page_chunk(id)
File "/home/lotfi/.local/lib/python3.6/site-packages/notion/store.py", line 286, in call_load_page_chunk
recordmap = self._client.post("loadPageChunk", data).json()["recordMap"]
File "/home/lotfi/.local/lib/python3.6/site-packages/notion/client.py", line 262, in post
"message", "There was an error (400) submitting the request."
requests.exceptions.HTTPError: Invalid input.我的代码是我用的是
from notion.client import NotionClient
import time
token_v2 = "my page tocken"
client = NotionClient(token_v2 = token_v2)
list_url_read = 'the url of the page page to read'
page_read = client.get_block(list_url_read)
list_url_post = 'the url of the page'
page_post = client.get_block(list_url_post)
print (page_read.title)发布于 2021-03-09 12:24:35
发布于 2021-09-02 06:12:48
不建议编辑依赖项的源代码,因为将来更新依赖项时肯定会引起冲突。
Fix PR 294已于2021年3月6日开放,尚未合并。
要解决GitHub上当前打开的PR (拉请求)的问题,请执行以下操作:
pip uninstall notion
然后要么:
pip install git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge或在requirements.txt添加中
git+https://github.com/jamalex/notion-py.git@refs/pull/294/mergehttps://stackoverflow.com/questions/66513210
复制相似问题