Version: 1.8.4
Add advanced web (HTTP and HTTPS) communications from either a client application or another Web Server.

WebPage Object

The WebPage object is used to represent an HTML page for parsing and resource collecting. Features include:

  • Full integration with the WebASP control. Fetch a page with the WebASP control and parse it with the WebPage object.
  • Use the WebPage object to get all images, links, meta-content, or other HTML resource on a page.
  • Use in conjunction with the WebASP control or use with locally saved HTML documents.
  • Use the WebTable object for powerful HTML table parsing (such as grabbing the value of a cell).

Development Environment

The WebPage object can be used in many development environments including:

  • Visual Studio .NET (.NET Framework)
  • Visual Basic (VB)
  • Visual C++ (VC++)
  • FoxPro
  • PowerBuilder
  • Delphi
  • C++ Builder
  • ASP
  • Office 97/2000

Interface Members

Public Constructors
WebPage Returns common HTML values and conducts search and retrieval operations on the specified page.
Public Properties
MetaNames The meta names that are available on the web page.
PrimaryFrame The URL of the primary frame for the web page.
Resources A collection of WebResource objects.
Source The HTML source from the page.
Title The title for the current web page.
UrlHost The UrlHost property specifies the host URL of the value in the Source property.
WebTables A collection of WebTable objects that represent all the tables on the web page.
Public Methods
Find Returns text or HTML source found between two tokens.
MetaContent Returns all the metadata for a metaname.
Paragraphs Returns a collection of text blocks that meet a specified minimum number of characters.
Text Returns the text from HTML source.

Code Example

How easy is the WebPage object to use? Check out the following VB example below, which demonstrates getting all images on a web page and saving them.

' WebPage object to use for parsing

Dim WebPage1 As New WebPage
Dim blnResult As Boolean

' set request url
WebASP1.Request.Url = "www.dart.com"

' get the page
WebASP1.Get

' set webpage source to html source from response
WebPage1.Source = WebASP1.Response.Body.ReadString

' iterate through WebResources, be sure to set WebPage.UrlHost first
WebPage1.UrlHost = WebASP1.Request.Url

For i = 1 To WebPage1.Resources.Count
   If WebPage1.Resources.Item(i).UrlType = resImg Then
      ' this WebResource is an image, so write to file
      blnResult = WebPage1.Resources(i).Get("C:\temp\img", True, 30000)
      If blnResult = True Then
         List1.AddItem WebPage1.Resources(i).UrlName & " is saved"
      End If
   End If
Next