gpt4 book ai didi

xpath - 使用 xpath 和 Telegram 即时 View 提取、创建和附加

转载 作者:行者123 更新时间:2023-12-03 23:13:32 25 4
gpt4 key购买 nike

<iframe src="https://expmle.com/subdirectory/sample_title" />

我该怎么办 创建 附加 下面 <a>使用 XPath 从上面的代码中标记和 Telegram Instant view职能?
<a href="https://expmle.com/subdirectory/sample_title">sample_title</a>

我想提取整个 src最后一部分 并使用它们来创建 <a>标签。

任何建议将不胜感激:)

最佳答案

这应该可以正常工作。

<a>: //iframe # Find iframe and convert it to <a>

@set_attr(href, ./@src) # Set href attribute from src

$anchor # Create variable for current <a>
@set_attr(text, ./@href) # We set new attribute for link which will processed by @match function, then @text attribute will be replaced by result of the @match
@match("\\w+_\\w+"): $@/@text # Now we find our future name of the link "sample_name" (this function will replace all in @text by our new name

@prepend(@text): $anchor # And then put this name to his $anchor

关于xpath - 使用 xpath 和 Telegram 即时 View 提取、创建和附加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54786100/

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