Users Pricing

forum

Home Forums Extracting texts from html tags – MindStick

Extracting texts from html tags

Anonymous User 2145 20 Sep 2014

I have a page like this which has 3 values in li tags

<li>Samsung</li>
<li>Nokia</li>
<li>Sony</li>
 
public string mobilename1 = "";
public string mobilename2 = "";
public string mobilename3 = "";
 
 
    // Use this for initialization
    void Start () {
 
        HtmlWeb htmlweb = new HtmlWeb();
        HtmlAgilityPack.HtmlDocument doc = htmlweb.Load(openUrl);
 
    foreach (HtmlNode nd in doc.DocumentNode.SelectNodes("//li"))
        {
            mobilenames=nd.InnerText.ToString();
 
        }

 

How can I store all 3 values in those strings?


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md