How To Screen Scrape a Web Page Using .NET C# Without Selenium

using System.Text;
using System.Net;
using System.IO;
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(URL);myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
string result = sr.ReadToEnd();
//Now, once you have this, perform the search on result string<br />
int stringFound = result.IndexOf("My search string");
Ryan Hayes

Ryan Hayes

Hi, I'm Ryan. I'm an 8x Microsoft MVP and lead engineer who loves building software development teams and multiplying their productivity.

Read More