Hey guys, i need to get the URL of an image on a webpage that im currently on in the webBrowser1 on my C# program. The image does not have an id and everytime i go to that page, the image is different, so i need to extract the URL of that image each time i go to that page. How would i do that?
UNOWN 0 Newbie Poster
Recommended Answers
Jump to PostHey guys
and girls... ;-P
if you want to do that inside of your program the easiest way is probably to use DocumentText property... in that case you get the code of the current page (in string which is convenient in that case; to get html code use Document …
Jump to Postif he wants to find something on the page that is currently loaded in the WebBrowser control what to use WebClient for? it will unnecessary once again send HTML request to the server which can takes some time... so basically from my point of view it's waste of resources...
Jump to Postactually my cut-n-paste from msdn is absurdly overdone...
eh... don't be so sure... as the code is from MSDN there can be some kind of performance differences... taking for example your little mistake (List<string> imgTagsHtml = new ArrayList<string>(); i guess typo) there is a big performance difference between List and …
All 10 Replies
GAME -5 Junior Poster
Szpilona 18 Light Poster
thines01 401 Postaholic Team Colleague Featured Poster
Szpilona 18 Light Poster
geezus 15 Newbie Poster
farooqaaa 48 Enthusiast
geezus 15 Newbie Poster
geezus 15 Newbie Poster
Szpilona 18 Light Poster
UNOWN 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.