Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i get Html Code?
Message
 
 
À
04/12/2002 03:37:13
Yan Kai On
Welkin System Ltd.
Tuen Mun, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
00729316
Message ID:
00729448
Vues:
16
Kai On,

I've never used the Web Browser Control Foundation Class, but there are at least couple of ways to do it.
*&  Method 1, with a Form and a Web Browser ActiveX Control.
*&
*& GetHTML() Method.
LOCAL lcURL, lcHTML
*&
Thisform.oleWebBrowser.Navigate(lcURL)
DO WHILE NOT Thisform.oleWebBrowser.ReadyState = 4
     *&  Just a loop to wait until the page is fully loaded.
ENDDO
lcHTML = Thisform.oleWebBrowser.Document.innerHTML
*&
RETURN lcHTML


*&  Method 2, with Microsoft.XMLHTTP Object.
LOCAL loHTTP, lcHTML, lcURL
*&
loHTTP = CreateObject("microsoft.XMLHTTP")
loHTTP.Open("Get", lcURL, .F.)
loHTTP.Send()
lcHTML = loHTTP.responseText
*&
RETURN lcHTML
HTH


>Hi,
>
>This is Antony. How can i get the HTML Code if I just know the URL in VFP7?
>I try to use the Web Browser Control Foundation Class, but, anyway, I can get the HTML code event it have a method GetHTML().
>
>Regards,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform