03-05-14, 12:54 AM
حتى اسهل المسالة حاولوا استخلاص الروابط من هذه الصفحة http://vb4arb.com/vb4/forumdisplay.php?65 اقصد روابط المواضيع بحيث استبدلها بروابط عادي لصفحات محملة.
Dim htmldoc As HtmlDocument = New HtmlDocument()
htmldoc.Load("abc.html")
Dim hrefs, classs As New List(Of String)
For Each link As HtmlNode In htmldoc.DocumentNode.SelectNodes("a")
On Error Resume Next
hrefs.Add(link.Attributes("href").Value)
classs.Add(link.Attributes("class").Value)
Next
MsgBox("hrefs:" & vbNewLine & Join(hrefs.Distinct.ToArray, vbNewLine))
MsgBox("classes:" & vbNewLine & Join(classs.Distinct.ToArray, vbNewLine))view-source:http://vb4arb.com/vb4/forumdisplay.php?65<a class="title" href="showthread.php?180-قوانين-كتابة-المواضيع" id="thread_title_180">قوانين كتابة المواضيع</a>Dim htmldoc As HtmlDocument = New HtmlDocument()
htmldoc.Load("abc.html")
Dim hrefs, classs As New List(Of String)
For Each link As HtmlNode In htmldoc.DocumentNode.SelectNodes("//a")
If link.Attributes("href") IsNot Nothing Then hrefs.Add(link.Attributes("href").Value)
If link.Attributes("class") IsNot Nothing Then classs.Add(link.Attributes("class").Value)
Next
MsgBox("hrefs:" & vbNewLine & Join(hrefs.Distinct.ToArray, vbNewLine))
MsgBox("classes:" & vbNewLine & Join(classs.Distinct.ToArray, vbNewLine))