gpt4 book ai didi

jquery - python:html 编写器?

转载 作者:行者123 更新时间:2023-11-28 20:28:38 26 4
gpt4 key购买 nike

使用 jquery 可以很容易地使用选择器技术在另一个元素中插入一些元素,我想知道是否有任何 python 库可以做与 jquery 类似的事情,原因是我希望服务器端 python 程序生成静态页面,需要解析 html 并向其中插入内容。

或者其他替代方案,根本不是 python 语言?

编辑:为了清楚起见,我想使用 python 编写以下程序:

h = html.parse('temp.html')
h.find('#idnum').html('<b>my html generated</b>')

h.close()

最佳答案

听起来像pyquery工作方式与您正在寻找的非常相似。

关于jquery - python:html 编写器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4612069/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com