منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
جلب الملفات بالأسم فقط من هذا الموقع - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : جلب الملفات بالأسم فقط من هذا الموقع (/showthread.php?tid=26987)



جلب الملفات بالأسم فقط من هذا الموقع - ابو روضة - 17-10-18

السلام عليكم ورحمة الله وبركاته.
حاولت بهذا الكود جلب الروابط بالاسماء كى يتم تشغيلهم بهذا الكود لكن مش عاوزة تظبط

                                                                                        
كود :
Dim url As String = "https://www.tvquran.com/ar/scholar/224/profile/%D8%B1%D8%B9%D8%AF-%D8%A7%D9%84%D9%83%D8%B1%D8%AF%D9%8A"
       Dim wc As New WebClient
       wc.Encoding = Encoding.UTF8
       Dim html As String = wc.DownloadString(url)
       Dim doc As New HtmlAgilityPack.HtmlDocument
       doc.LoadHtml(html)
       For Each n As HtmlAgilityPack.HtmlNode In doc.DocumentNode.SelectNodes("//div[@class='listitem-details']/h4/a[@href]")
           ListBox1.Items.Add(n.InnerText)
           lst.Add("https://www.tvquran.com/ar/scholar/224/profile/رعد-الكردي" & n.Attributes("href").Value)
       Next

                                                                           
                                                                الموقع
                                                                      
                                                                  رعد الكردي


RE: جلب الملفات بالأسم فقط من هذا الموقع - rnmr - 18-10-18

جرب هذا

كود :
Dim url As String = "https://www.tvquran.com/ar/scholar/224/profile/%D8%B1%D8%B9%D8%AF-%D8%A7%D9%84%D9%83%D8%B1%D8%AF%D9%8A"
Dim wc As New WebClient
wc.Encoding = Encoding.UTF8
Dim html As String = wc.DownloadString(url)
Dim r = Regex.Matches(html, "<div class=""share-box"" id="".*?</a>", RegexOptions.Singleline)
For Each t As Match In r
   ListBox1.Items.Add(Regex.Match(t.Value, "(?<=data-title="").*?(?="")").Value)
   lst.Add("https://" & Regex.Match(t.Value, "(?<=href="").*?(?="")").Value)
Next



RE: جلب الملفات بالأسم فقط من هذا الموقع - ابو روضة - 18-10-18

(18-10-18, 08:27 AM)rnmr كتب : جرب هذا


كود :
Dim url As String = "https://www.tvquran.com/ar/scholar/224/profile/%D8%B1%D8%B9%D8%AF-%D8%A7%D9%84%D9%83%D8%B1%D8%AF%D9%8A"
Dim wc As New WebClient
wc.Encoding = Encoding.UTF8
Dim html As String = wc.DownloadString(url)
Dim r = Regex.Matches(html, "<div class=""share-box"" id="".*?</a>", RegexOptions.Singleline)
For Each t As Match In r
  ListBox1.Items.Add(Regex.Match(t.Value, "(?<=data-title="").*?(?="")").Value)
  lst.Add("https://" & Regex.Match(t.Value, "(?<=href="").*?(?="")").Value)
Next

بارك الله فيك أخى الكريم وجزاك كل خير  فعلا نجح مائة بالمائة