有没有办法搜索搜索包括"<"个字符在内的所有字符的字符串?



我会尽量说得具体一些。我试过用短信。内容和…Innerhtml和两者都缺少"<&quot;字符搜索。当搜索下面的整个字符串时,它看不到它。

这是我在一个特定的html页面上搜索的内容。

"

'231-8&quot;},&quot;availability_html&quot;:&quot;&lt;p class=&quot;stock out-of-stock'

"这是我的代码…

'if ('
'document.documentElement.textContent.search('231-8&quot;},&quot;availability_html&quot;:&quot;&lt;p class=&quot;stock out-of-stock') != -1)'
'{'
'alert("FOUND!");'
'} else {'
'alert("NOT FOUND!");'
'}' 

"我可以搜索字符串的第一部分一直到"<quot;部分,它工作良好。

我做错了什么?

这就是我的解决方案。

'231-8&quot;},&quot;availability_html&quot;:&quot;<p class=\\&quot;stock out-of-stock

最新更新