gpt4 book ai didi

javascript - imacros 从提取的 html 中剪切了 txt 的一部分

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

我正在创建宏,但遇到问题。

每次我重新加载时,该网站都会更改其 iframe 名称。所以我想获取 iframe 名称并将其放入变量中。问题是我不知道如何从提取的 html 中获取 iframe 名称

TAG POS=7 TYPE=iframe ATTR=ID:* EXTRACT=HTM

<iframe src="https://www.facebook.com/plugins/comments.php?api_key=271750421132&amp;channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2F7tUlZKGPU61.js%3Fversion%3D41%23cb%3Df39559b33f3fe54%26domain%3Dwww.collegehumor.com%26origin%3Dhttp%253A%252F%252Fwww.collegehumor.com%252Ff2b6c86b5ce5e7%26relation%3Dparent.parent&amp;colorscheme=light&amp;href=http%3A%2F%2Fwww.collegehumor.com%2Ftoplist%2F6754891%2Fthe-biggest-pet-peeves&amp;locale=en_US&amp;mobile=false&amp;numposts=10&amp;order_by=social&amp;sdk=joey&amp;skin=light&amp;version=v2.0&amp;width=570" class="fb_ltr" title="Facebook Social Plugin" style="border: medium none; overflow: hidden; height: 2589px; width: 607px; outline: 1px solid blue;" scrolling="no" name="f17c627e8f47218" id="f31982b5a1b9c64"></iframe>

我只需要获取 iframe id,即 f31982b5a1b9c64。我对 javascript 知之甚少,所以我似乎无法弄清楚这一点。

最佳答案

如果您想获取 iframe 名称,请添加此行:

SET frameName EVAL("'{{!EXTRACT}}'.match(/name="(\w*)"/)[1];")

或者这个来获取 iframe id:

SET frameId EVAL("'{{!EXTRACT}}'.match(/id="(\w*)"/)[1];")

关于javascript - imacros 从提取的 html 中剪切了 txt 的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31996945/

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