Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web Development
Expertise: Beginner
Apr 14, 2000

Scan HTML Code for Data Extraction

Question:
Is there a way (using VB) to load a Web page (without actually showing the page through a browser or otherwise) and then extract the HTML code for use in extracting data (whether by scanning the actual HTML or saving it as a text file for later automated scanning)?

Answer:
Yes there is. Place the Microsoft Internet Control on a form, navigate to the page you want to scan, using the Navigate method. Once the page has been downloaded (beware downloading is asynchronous) you can use the WebBrowser's Document object to gain entry into the downloaded document's DHTML object model. The following code will return all the HTML in a document:

s=WebBrowser1.Document.All(0).OuterHTML
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date