using Webbrowser1.Document to get images?
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
7 posts
Page 1 of 1
trying to get an image to be set onto a picture box using this
Code: Select all
but since i dont know what im doing it won work anyhelp on this? WebBrowser1.Document.Images.GetElementsByName("p_icon")
PictureBox2.ImageLocation = ("p_icon")
Do you mind sharing the URL to the page you are trying to download the image from?
But just from the info you've provided, here's something that might work:
But just from the info you've provided, here's something that might work:
Code: Select all
You could put that in WebBrowser.DocumentCompleted, or in some Button.Dim images As HtmlElementCollection = WebBrowser1.Document.Images.GetElementsByName("p_icon")
For Each i As HtmlElement In images
PictureBox1.ImageLocation = i.GetAttribute("src")
Next
comathi wrote:Do you mind sharing the URL to the page you are trying to download the image from?it didnt show up the imaged but, i am also having problems with trying to get the id and inputing the id/value of the id into a textbox. any idea on that. thanks on the other one i will try to tweak it.
But just from the info you've provided, here's something that might work:
Code: Select allYou could put that in WebBrowser.DocumentCompleted, or in some Button.Dim images As HtmlElementCollection = WebBrowser1.Document.Images.GetElementsByName("p_icon") For Each i As HtmlElement In images PictureBox1.ImageLocation = i.GetAttribute("src") Next
GaiaonlineHD wrote:this is one of them a_createdate from this site. http://quickfind.kassad.in/comathi wrote:Do you mind sharing the URL to the page you are trying to download the image from?it didnt show up the imaged but, i am also having problems with trying to get the id and inputing the id/value of the id into a textbox. any idea on that. thanks on the other one i will try to tweak it.
But just from the info you've provided, here's something that might work:
Code: Select allYou could put that in WebBrowser.DocumentCompleted, or in some Button.Dim images As HtmlElementCollection = WebBrowser1.Document.Images.GetElementsByName("p_icon") For Each i As HtmlElement In images PictureBox1.ImageLocation = i.GetAttribute("src") Next
GaiaonlineHD wrote:trying to get an image to be set onto a picture box using this
Code: Select allbut since i dont know what im doing it won work anyhelp on this?WebBrowser1.Document.Images.GetElementsByName("p_icon") PictureBox2.ImageLocation = ("p_icon")
not sure if im correct but to show the image must it not be
Code: Select all
instead ofPictureBox2.Image = ("p_icon")
Code: Select all
PictureBox2.ImageLocation = ("p_icon")
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Dummy1912 wrote:tried that before.GaiaonlineHD wrote:trying to get an image to be set onto a picture box using this
Code: Select allbut since i dont know what im doing it won work anyhelp on this?WebBrowser1.Document.Images.GetElementsByName("p_icon") PictureBox2.ImageLocation = ("p_icon")
not sure if im correct but to show the image must it not beCode: Select allinstead ofPictureBox2.Image = ("p_icon")
Code: Select allPictureBox2.ImageLocation = ("p_icon")
Here's the code to at least get the a_createdate:
Code: Select all
Dim h2List As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("h2")
For Each h2 As HtmlElement In h2List
If h2.GetAttribute("id") = "a_createdate" Then
MessageBox.Show(h2.InnerText)
End If
Next
7 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023