ATR Posted May 16, 2012 Posted May 16, 2012 (edited) I don't understand why autoit don't return elements of the web page... #include <IE.au3> _IENavigate($Fenetre_IE, "http://www.communes.com/rhone-alpes/ain/") $Contenu_HTML = _IEBodyReadHTML($Fenetre_IE) $BalisesLI = _IETagNameGetCollection($Fenetre_IE, "li") consolewrite(@extended & @crlf) For $BaliseLI In $BalisesLI $Villes = StringRegExp($BaliseLI.innerhtml, '<a href="' & $Departements & '(?:.*?)_(d{5})/">(.*?)<', 1) If @error = 0 Then FileWriteLine($DossierEnregistrement & "Villes de frances.txt", $Villes[0] & @TAB & $Villes[1]) EndIf Next _IEQuit($Fenetre_IE) Thanks in advance Edited May 16, 2012 by ATR
jdelaney Posted May 16, 2012 Posted May 16, 2012 use outerhtml to return the whole element of the object $oTempObj.outerhtml IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
jdelaney Posted May 16, 2012 Posted May 16, 2012 (edited) Try it out...make sure you initialize an IE Dom object though..._ieattach or _iecreate: #include <IE.au3> _IENavigate($Fenetre_IE, "http://www.communes.com/rhone-alpes/ain/") $Contenu_HTML = _IEBodyReadHTML($Fenetre_IE) $BalisesLI = _IETagNameGetCollection($Fenetre_IE, "li") consolewrite(@extended & @crlf) For $BaliseLI In $BalisesLI ;New code to test $stest = $BaliseLI.outerhtml msgbox ( 4096, "test", $stest ) $Villes = StringRegExp($BaliseLI.innerhtml, '<a href="' & $Departements & '(?:.*?)_(d{5})/">(.*?)<', 1) If @error = 0 Then FileWriteLine($DossierEnregistrement & "Villes de frances.txt", $Villes[0] & @TAB & $Villes[1]) EndIf Next _IEQuit($Fenetre_IE) Edited May 16, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
jdelaney Posted May 16, 2012 Posted May 16, 2012 (edited) i highly recommend getting firefox, and firebug...then you can go over to the DOM tab of the firebug, and view all the .XXX (properties) you can pull from any given element. Edited May 16, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now