tags:

views:

30

answers:

1

Hello,

On my ASP.Net page in C#, the user is able to enter an url (web page). When it's done, I would want to get the picture in this page. For an example of this, go on Facebook and write a status with an url in it. A panel open with the description of the page AND the picture.

Is there a parser or a little application that I can use for this?

Thanks!

DarkJaff

A: 

Look at this post for code on how to retrieve html DOM from an url . Once you get a reference to the IHTMLDocument3 instance, use the getElementsByTagName method to retrieve all IMG tags, and take the first.

Andrea Parodi
Eum... I believe it's my question who's not clear but I want to get the first picture from the page (url). So, for example,if the user enter this url: http://www.monkeylinx.com/ViewPost.aspx?post=43, he will get the image with the man on the left... Facebook do that when you write and url...
DarkJaff
Understand, I'll edit my answer: you have to read the DOM model of the page entered and seek for first IMG node.
Andrea Parodi
Thanks a lot, that's exactly what I was searching for!
DarkJaff