gpt4 book ai didi

text - 如何让greasemonkey 检查是否在页面上找到文本

转载 作者:行者123 更新时间:2023-12-04 17:57:43 25 4
gpt4 key购买 nike

我确实在谷歌和用户脚本网站上做了一些研究,但没有找到答案。

那么基本上如何检查页面上是否找到特定文本?
文本没有特殊标签或任何东西。

最佳答案

对于 FF GM 来说,一种粗略但快速的方法:

if (/Text you are looking for/i.test (document.body.innerHTML) )
{
alert ("Found it!");
}

//--- Looking for one of two different texts...
if (/(Text ONE that you are looking for)|(Text TWO that you are looking for)/i.test (document.body.innerHTML) )
{
alert ("Found one!");
}

如需更集中的搜索,请使用 jQuery contains this previous question .

关于text - 如何让greasemonkey 检查是否在页面上找到文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5059986/

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