Clem
-
7 mai 2001 à 14:34
cs_rootdaoud
Messages postés2Date d'inscriptionvendredi 31 octobre 2003StatutMembreDernière intervention 4 février 2005
-
4 févr. 2005 à 18:52
Comment lire la source d'une page web comme www.vbfrance.com ?
Aaaahhh !!!!!!!!!!!!!! il me semblait bien que la question n'était ni en rapport avec Vb ni très difficile à répondre...
Source : www.allapi.net
The Professional and Enterprise Editions of Visual Basic are shipped with the Winsock control. This control allows you to use the low level Windows Sockets to connect to remote servers and execute commands or download Web pages. This tip shows how to connect to a server and download a Web page.
Code
You must have a Winsock control loaded into the project. This code assumes the control is called Winsock1. There also must be a text box on the form which is called txtWebPage.
First, connect to the remote computer using the following code:
cs_rootdaoud
Messages postés2Date d'inscriptionvendredi 31 octobre 2003StatutMembreDernière intervention 4 février 2005 4 févr. 2005 à 18:52
voilà le code que vous permet de faire ça:
s'il ya une question : [mailto:rootdaoud@yahoo.fr rootdaoud@yahoo.fr]
Private WithEvents IE As InternetExplorer
Set IE = New InternetExplorer
IE.navigate "[/ www.vbfrance.com]"
Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim ch as String
Dim Doc As IHTMLDocument2
Set Doc = IE.document
ch =Doc.body.innerhtml
ENB: n'oubliez pas de faire la refference a microsoft html object library(projet/references)
nd Sub.