1

I have HTML with this code inside:

    <div id="div_space">
    <div id="div" class="SCREENONLY" itemprop="description">Baby you<br />
    abcdefghijklmnop123456789</div><div id="song" class="PRINTONLY">blabla</div>

And i want to parse abcdefghijklmnop123456789 from the html with Regex:

string str = "<div id=ֿ\"div_spaceֿ\">(.*?)</div>"
Regex regex = new Regex(str);
Match match = regex.Match(html);

And Match is always empty, any idea what could be the problem?

YosiFZ
  • 7,466
  • 20
  • 105
  • 206

1 Answers1

5

AS Slaks commented you can get help of library like Html Agile pack to do this task

var dives = from div in htmlDoc.DocumentNode.Descendants("div")
           where div.Id == "div_space" 
           select div; 
carla
  • 1,880
  • 1
  • 34
  • 41
Damith
  • 60,955
  • 13
  • 99
  • 152