Scan a string on this webpage, and then scan the string
/* Get the content in the body */
// Var content = document. getElementsByTagName ("body") [0]. innerHTML;
/* If there are many iframe values in the body, you need to find them cyclically */
Var contents = document. getElementsByTagName ("iframe ");
// Var content = $ (contents [0]). contents (). find ("body" example .html ();
Var size = contents. length;
Var I = 0;
Var value = 0;
Var temp = "";
For (I; I <size; I ++ ){
Temp = $ (contents [I]). contents (). find ("body" example .html ();
Value + = temp. indexOf ('widget-name = "rating" ', 0 );
}
How does javascript check whether a webpage element contains a specific string?
Function check (CheckStr)
{
Var str;
Str = document. getElementById ("ooo"). innerHTML;
If (str. indexOf (CheckStr) =-1)
Return false;
Else
Return ture;
}
C # determine whether a webpage contains a string
This code is useful. You can use the differences between the two webpages to determine whether the webpage is redirected to the desired webpage. The Code is as follows: reprinted, please specify the Source: using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. windows. forms; namespace determines that the webpage contains a string {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void Form1_Load (object sender, EventArgs e) {this. webBrowser1.Url = new Uri (& quot;);} private void Button#click (object sender, EventArgs e) {string html = webBrowser1.Document. body. outerHtml; if (html. contains (& quot; minxiangyangwfasg & quot;) {this. label1.Text = & quot; this string exists & quot;} else {this. label1.Text = & quot; this string does not exist!