gpt4 book ai didi

perl - 在 Perl HTML::TreeBuilder 中获取/设置 innerHTML?

转载 作者:行者123 更新时间:2023-12-01 04:17:55 26 4
gpt4 key购买 nike

在 Perl HTML::TreeBuilder 中获取/设置 innerHTML?我可以获得innerHTML,但不知道如何设置。

提前致谢。

最佳答案

我不确定这种方法是否会让您满意,但您可以使用 html($html)方法来自 pQuery :

This method is akin to the famous JavaScript/DOM function innerHTML.

If called with no arguments, this will return the the inner HTML string of the first DOM element in the pQuery object.

If called with an HTML string argument, this will set the inner HTML of all the DOM elements in the pQuery object.



至于为什么 pQuery 可能会让你满意,引用 POD 的话:

pQuery::DOM is roughly an attempt to duplicate JavaScript's DOM in Perl. It subclasses HTML::TreeBuilder/HTML::Element so there are a few differences to be aware of. See the pQuery::DOM documentation for details.

关于perl - 在 Perl HTML::TreeBuilder 中获取/设置 innerHTML?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2954422/

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