1

我有包含这段代码的 HTML:

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

我想abcdefghijklmnop123456789从 html中解析Regex

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

而且匹配总是空的,知道可能是什么问题吗?

4

1 回答 1

5

AS Slaks 评论说,您可以获得Html Agile pack之类的库的帮助来完成此任务

var dives = from div in htmlDoc.DocumentNode.Descendants("div")
           where div.Id == "div_space" 
           select div; 
于 2013-07-07T12:53:38.790 回答