Sign in to follow this  
Followers 0
ATR

Problem using _IETagNameGetCollection or bug ?

5 posts in this topic

#1 ·  Posted (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 by ATR

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

Can I have an example ?

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0