Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extracting HTML from Web Browser control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00573402
Message ID:
00573423
Vues:
16
>>>>Hi all,
>>>>
>>>>I have an instance of the Web Browser control on a VFP 7 form. I've successfully navigated to the desired URL.
>>>>
>>>>How do I now gain access, programmatically, to the HTML code for that URL? I need to parse the HTML for a particular tag, and would like to use the new STREXTRACT function of VFP 7 to search for the value associated with the tag.
>>>>
>>>>TIA,
>>>
>>>
Thisform.WebControl1.document.documentElement.innerHTML
>>>HTH
>>
>>Hi J,
>>
>>That gives me a "Member DOCUMENT does not evaluate to an object" error.
>>
>>Do I possibly need to wait for the page to finish loading before I fire this code? Is there some type of a property of the Browser control which I can monitor that tells me when the page is finished?
>>
>>Appreciate all your (quick) help...
>
>Yes, the page needs to be loaded already for this to work. To wait for the page to be loaded, use this snippet:
>
Do While Thisform.WebControl1.Document.ReadyState <> "complete"
>Enddo
>Could be in the init of the form or web control container.

Hmmm...it still can't find the DOCUMENT member. I'm firing this DO WHILE in the Init() of the form, right after the Navigate() method that sets the URL (I know it's a good URL, since it's our company's own site).

If I suspend, wait a few seconds, and then RESUME, it works like a champ.

I'm thinking an old-fashioned "timing loop" is called for here...any other more OOP-y ideas? (bg)
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform