我会尽量说得具体一些。我试过用短信。内容和…Innerhtml和两者都缺少"<"字符搜索。当搜索下面的整个字符串时,它看不到它。
这是我在一个特定的html页面上搜索的内容。
"
'231-8"},"availability_html":"<p class="stock out-of-stock'
"这是我的代码…
'if ('
'document.documentElement.textContent.search('231-8"},"availability_html":"<p class="stock out-of-stock') != -1)'
'{'
'alert("FOUND!");'
'} else {'
'alert("NOT FOUND!");'
'}'
"我可以搜索字符串的第一部分一直到"<quot;部分,它工作良好。
我做错了什么?
这就是我的解决方案。
'231-8"},"availability_html":"<p class=\\"stock out-of-stock