通過HtmlAgilityPack 實現對html頁面解析
HtmlDocument doc = new HtmlDocument(); doc.Load(yourStream); var itemList = doc.DocumentNode.SelectNodes("//span[@class='hidden first']")//this xpath selects all span tag having its class as hidden first .Select(p => p.InnerText) .ToList();
HtmlNode node = doc.DocumentNode.SelectSingleNode("//td[.='銷售狀態:']"); //獲取第一個td內容為'銷售狀態:'的節點
