HtmlElementCollection pTags = wb.Document.GetElementsByTagName("p") HtmlDocument doc = wb.Document.OpenNew(true) Create web browser on runtime and assign html document to it The week's prints consisted of two ILS, and sever ITS." String input = PricingsIt was another active week for names leaving the database. Private void Form1_Load(object sender, EventArgs e) Return Regex.Replace(source, "", string.Empty) I'm not sure if you are working in win forms or web, but an idea is to create a web browser document and loop through its element to get the p tags and find text then clean that from html tags within using Regex, see example below: public static string StripTagsRegex(string source) ![]() The above code is throwing this error - : Expression must evaluate to a node-set, on the following line of code var nodes = thanks for your time and help. ![]() Price = bottom.Substring(bottom.IndexOf("Pricings"), 8) If (bottom.ToLower().Contains("pricings")) The week's prints consisted of two ILS, and sever ITS. The week's prints consisted of two ILS, and sever ITS.ĭesired output string: It was another active week for names leaving the database. I am writing to seek help, in how I can extract 1st two sentences under the tag.įor example, input string: PricingsIt was another active week for names leaving the database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |