0
問題一:
我有一個與特定內容中提取網頁(WebSource
)的URL的程序(/articles/
)過濾器使用htmlagility提取鏈接從網頁 - vb.net
Dim links As New List(Of String)()
Dim htmlDoc As New HtmlAgilityPack.HtmlDocument()
htmlDoc.LoadHtml(WebSource)
For Each link As HtmlNode In htmlDoc.DocumentNode.SelectNodes("//a[@href]")
Dim att As HtmlAttribute = link.Attributes("href")
If att.Value.Contains("/articles/") Then
links.Add(att.Value)
End If
Next
是它可能的網址進行查詢,並用兩個值進行篩選,例如在科技網站我想找到所有網址都包含/articles/
和LG
問題二:
頁提取的URL是不完整的HTTP地址例如我的結果之一是
/articles/car
而是完整地址,例如
http://website.com/articles/car
的我怎樣才能解決這個問題?
:字符串?沒有。如果我使用'「/ articles /」&「LG」'實際上我使用'「/ articles/LG」'。你知道什麼關於字符串????????? –
抱歉的男人.... @ArashHatami後修改 – 2016-01-07 14:55:51
這太愚蠢了!爲什麼我的思想不是......非常感謝你 –