1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Test2 As String = "http://vi.vipr.ebaydesc.com/ws/eBayISAPI.dll?ViewItemDescV4&item=182246994036&t=1475242705000&tid=7710&category=115699&seller=www.expondo.de*&excSoj=1&excTrk=1&lsite=77&ittenable=false&domain=ebay.de&descgauge=1"
Dim ResultatTest2 As String = GetInnertextClassName(Test2, "anzeige-nummer")
MessageBox.Show(ResultatTest2)
End Sub
Public Function GetInnertextClassName(ByVal TheLink As String, ByVal ClassN As String) As String
Dim req As HttpWebRequest = DirectCast(HttpWebRequest.Create(TheLink), HttpWebRequest)
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"
Dim resp As HttpWebResponse = DirectCast(req.GetResponse, HttpWebResponse)
Dim sr As New IO.StreamReader(resp.GetResponseStream)
Dim doc As New mshtml.HTMLDocument
Dim iDocument As mshtml.IHTMLDocument2 = doc
iDocument.open()
iDocument.write(sr.ReadToEnd)
iDocument.close()
Return doc.getElementById(ClassN).innerText
sr.Close()
resp.Close()
End Function |
Partager