开发者

how to load text as html using Html Agility Pack

开发者 https://www.devze.com 2023-01-13 21:26 出处:网络
<table class=\"\\\"matches\\\"> <thead> <tr class=\"\\\"sub-head\\\"> <th clas开发者_开发问答s=\"\\\"day\\\">
<table class="\"matches   \">
<thead>
    <tr class="\"sub-head\">
        <th clas开发者_开发问答s="\"day\">
            Day<\/th><th class="\"date\">
                Date<\/th><th class="\"team team-a\">
                    Home team<\/th><th class="\"score-time\">
                        Score\/Time<\/th><th class="\"team team-b\">
                            Away team<\/th><th class="\"events-button button\">
                                &nbsp;<\/th><th class="\"info-button button\">

How can i load or parse this text as html then extract it data using HAP? Thanks


Here you go:

string input; 
var htmlDocument = new HtmlDocument();
htmlDocument.LoadHtml(input); or htmlDocument.LoadHtml(@input);


This answer may help get you started.

Have you got the extra backslashes in there by mistake, or is that how the source HTML document actually looks?

0

精彩评论

暂无评论...
验证码 换一张
取 消