Scusate se disturbo.
Non riesco ad estrarre un'immagine di un prodotto di ebay tramite il webbrowser.
Questo codice l'ho usato per la copertina di facebook:
codice:
Dim images As System.Windows.Forms.HtmlElementCollection
images = Webbrowser1.Document.GetElementsByTagName("img")
For Each Img As System.Windows.Forms.HtmlElement In images
If Img.OuterHtml.Contains("class=""coverPhotoImg photo img""") Then
PictureBox1.ImageLocation = Img.GetAttribute("src")
UrlImmagine = Img.GetAttribute("src")
Exit For
Else
End If
Next
Su facebook funziona,su ebay no.
Questo è il codice che uso su ebay:
codice:
Dim images As System.Windows.Forms.HtmlElementCollection
images = WebBrowser1.Document.GetElementsByTagName("img")
For Each Img As System.Windows.Forms.HtmlElement In images
If Img.OuterHtml.Contains("class=""img img500""") Then
PictureBoxImmagineProdotto.ImageLocation = Img.GetAttribute("src")
UrlImmagine = Img.GetAttribute("src")
Exit For
Else
End If
Next
Ho provato anche tramite id, con questo codice:
codice:
UrlImmagine = WebBrowser1.Document.GetElementById("icImg").InnerText
Non funziona lo stesso, non mi restituisce niente.
Qualcuno sa come risolvere?
Grazie in anticipo.