Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Getting Text Value From DIV Node(s)

$
0
0
We are trying to get the text values from DIV nodes in the attached HTML.  I marked the start of what we are looking for
with

Quote

*****************************************************************************************************
We are looking for the store name, address and tele from the DIV node(s) that follow
*****************************************************************************************************

The HTML was produced using this

[ autoit ]         
#include <array.au3> #include <ie.au3> #include <string.au3> _IEErrorHandlerRegister("ERR") local $odiv, $odivs, $url $url = 'http://www.acehardware.com/mystore/storeLocator.jsp#53214|null' return_addresses($url) func return_addresses($url) local $str,$aADDR local $oIE = _IECreate($url,0,0) _IELoadWait($oIE) filewrite(@scriptdir & '\body.txt',_IEBodyReadHTML($oIE)) ;~ local $odivs = _IETagNameGetCollection($oIE,'div') ;~ for $odiv in $odivs ;~ if $odiv.id = '"storeList1"' then ;~ For $oChild In $odiv.childnodes ;~ ConsoleWrite($oChild.innertext & @CRLF) ;~ Next ;~ endif ;~ next _IEQuit($oIE) $oIE = 0 endfunc Func ERR() consolewrite(StringStripWS($oIEErrorHandler.WinDescription, 2) & @lf) ConsoleWrite('Id = ' & $odiv.id & @LF) ConsoleWrite('Title = ' & $odiv.title & @LF) ConsoleWrite('Class = ' & $odiv.classname & @LF) ConsoleWrite(_stringrepeat('*',100) & @LF) Return EndFunc

kylomas

edit: Ths HTML file can be found here

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>