[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Identify Images and tables from a web page

benita ron

2/29/2012 10:16:00 AM


I want to put on a form something as a listview that will display all
the images and tables that exist on a specific web page. The list view
should display the names of the objects and when scrolling on its
lines, a picture box will display the object itself

Is it doaable (at least with images)?

Many thanks
Avi

4 Answers

Mayayana

2/29/2012 1:13:00 PM

0

It's entirely doable, but it's not a VB issue.

Probably the best way: Parse the webpage code using
a tokenizing routine. HTML isn't too hard because all
relevant data is between < and >.

The other way to do it would be to go through the
document object model after loading the page into
a WebBrowser window. That could be a security
risk and it's clunky. But it's relatively simple. You'd
have to go through each element in "all" and check
tagName, ID, etc. for each.
For that you'll want to set a reference to mshtml.dll
to get the DOM.

--
--
"benita ron" <benita.ron@gmail.com> wrote in message
news:13cdf0ca-43be-4421-8b2a-eb0d1fea1e68@y10g2000vbn.googlegroups.com...
|
| I want to put on a form something as a listview that will display all
| the images and tables that exist on a specific web page. The list view
| should display the names of the objects and when scrolling on its
| lines, a picture box will display the object itself
|
| Is it doaable (at least with images)?
|
| Many thanks
| Avi
|


Clive Lumb

2/29/2012 2:15:00 PM

0

"benita ron" <benita.ron@gmail.com> a écrit dans le message de groupe de
discussion :
13cdf0ca-43be-4421-8b2a-eb0d1fea1e68@y10g2000vbn.googlegroups.com...
>
> I want to put on a form something as a listview that will display all
> the images and tables that exist on a specific web page. The list view
> should display the names of the objects and when scrolling on its
> lines, a picture box will display the object itself
>
> Is it doaable (at least with images)?
>
> Many thanks
> Avi

This could set you on the right path
http://www.codeguru.com/vb/vb_internet/html/article...


avi

3/1/2012 5:57:00 AM

0

Thanls a lot! It works great with images. Some idea about how to identify tables?

Best regards
Avi

Clive Lumb

3/1/2012 8:42:00 AM

0

"avi" <aviben@bezeqint.net.il> a écrit dans le message de groupe de
discussion :
29262888.915.1330581410397.JavaMail.geo-discussion-forums@vbbed8...
> Thanls a lot! It works great with images. Some idea about how to identify
> tables?
>
> Best regards
> Avi

Tables are always between <table .....> and </table>
Usually tables have an ID, eg <table id="DataList1" ....
Tables then have rows <tr> ... </tr>
Rows then have cells <td> ... </td>

So the simplest table possible is:
<table>
<tr>
<td>
This is a single row, single column table
</td>
</tr>
</table>