Skip to main content
Hello! I'm Wenhao

Here I will share the problems and solutions encountered by various technology stacks, take you to understand the latest technology stacks and how to apply them in actual development, and hope that my development experience will inspire you

You can take a look at it casually and check Note, {project}, {link}. I will also share Idea for programming learning


New Blog

在Notion中,可以通过Python的Notion API 来获取页面的块和子块。首先需要安装Notion API 的Python库:

pip install notion-client

在代码中引入notion_client库和相关模块,并设置访问 数据库 所需的token和datab as e的id:

from notion_client import Client

# 认证
notion = Client(auth="YOUR_API_KEY")

# 数据库ID
database_id = "DATABASE_ID"

接下来,使用notion.pages.get() 函数 来获取指定页面的块和子块:

# 获取页面信息
page = notion.pages.get(page_id="YOUR_PAGE_ID")

# 获取块和子块
block_ids = page.get("content")
for block_id in block_ids:
block = notion.blocks.retrieve(block_id)

运行以上代码后,就可以打印出指定页面中的所有块和子块的信息。 请注意,在代码中需要替换相应的YOUR_ API _KEY、DATAB AS E_ID和YOUR_PAGE_ID。 免责声明 本文内容通过AI工具匹配关键字智能整合而成,仅供参考,火山引擎不对内容的真实、准确或完整作任何形式的承诺。如有任何问题或意见,您可以通过联系 进行反馈,火山引擎收到您的反馈后将及时答复和处理。 展开更多


wenhaoNotionDefault2 min read

目的:每天都要通过微信公众号进行发送文章,但是每次仅仅是修改图文信息,其他设置并无不同,故通过自动化可节省大量时间,实现一键发文。 在这过程中,也遇到了一些问题,总结如下: (1)切换窗口操作时遇到 wd.title的名字一模一样(暂时使用了选择最近打开窗口解决) (2)不能准确定位到元素,后来通过copy_xpath解决,之前一直手写,后续要加强手写能力 (3)有一个输入框一直定位不到,原来是iframe中的,切换了一下就解决了 (4)下拉选项元素定位不到,要加等到时间(sleep(3)) (5)一个元素定位不到,原因是不处于可视界面,将滚动条拖动到元素位置,便可以定位到

wenhaoPython3 min read

I have, as you might expect, authored several versions of this Article, both in my head and on the page, as the most extraordinary weekend of my career has unfolded. To briefly summarize:

  • On Friday, then-CEO Sam Altman was fired from OpenAI by the board that governs the non-profit; then-President Greg Brockman was removed from the board and subsequently resigned.
  • Over the weekend rumors surged that Altman was negotiating his return, only for OpenAI to hire former Twitch CEO Emmett Shear as CEO.
  • Finally, late Sunday night,
  • Satya Nadella announced via tweet
  • that Altman and Brockman, “together with colleagues”, would be joining Microsoft.

wenhaoDefault10 min read