META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1" /> TITLE>Microsoft Corporation META http-equiv="PICS-Label" content="(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0))" /> META NAME="KEYWORDS" CONTENT="products; headlines; downloads; news; Web site; what's new; solutions; services; software; contests; corporate news;" /> META NAME="DESCRIPTION" CONTENT="The entry page to Microsoft's Web site. Find software, solutions, answers, support, and Microsoft news." /> META NAME="MS.LOCALE" CONTENT="EN-US" /> META NAME="CATEGORY" CONTENT="home page" />
我想知道什麼XPATH我需要使用HTML敏捷包獲取Category元標記的Content屬性的值。 (我刪除了html代碼中每行的第一個<,所以它會發布)。使用XPATH獲取HTML標記屬性與HTML敏捷包
其實,稍微好一點的辦法是使用
title = doc.DocumentNode.SelectSingleNode("//meta[@name='title']").GetAttributeValue("content", String.Empty)
– Eugene 2010-07-14 21:09:23或者更好的是 標題= doc.DocumentNode.SelectSingleNode( 「//元[@名稱= '標題']/@內容」) – Eugene 2010-07-14 21:15:30
的上面一個title = doc.DocumentNode.SelectSingleNode(「// meta [@ name ='title']/@ content」)。ToString不起作用... – Eugene 2010-07-14 21:21:38