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

Display the last array only

$
0
0
I want to only display the last table that is found on the webpage...
Suggestions on doing this?
[ autoit ]         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <guilistview.au3> #include <StaticConstants.au3> #include <IE.au3> $fIni="c:\temp\zip.ini" $count= 1 $zip=IniRead($fIni,"Zip",$count,"NotFound") $url="http://hosted.where2getit.com/truevalue/tv2.html?form=locator_search&addressline="&$zip&"&search=&geoip=1" $oIE=_IECreate($url,0,0,'','') _IENavigate($oIE,$url) _IEPropertySet($oIE,"silent","true") _IETableReport($oIE) ;$sHtml = _IEDocReadHTML($oIE) ;$filename="tv"&$count&".html" ;$file = FileOpen($filename, 2) ;FileWrite($file, $sHTML) ;FileClose($file) Func _IETableReport($oIE) Local $iIndex = 0 $colTables = _IETableGetCollection($oIE) MsgBox(0, "Table Info", "There are " & @extended & " tables on the page") for $oTable In $colTables ;===== stolen from IE include _IETableWriteToArray, to find errors Local $i_cols = 0, $tds, $i_col Local $trs = $oTable.rows For $tr In $trs $tds = $tr.cells $i_col = 0 For $td In $tds $i_col = $i_col + $td.colSpan Next If $i_col > $i_cols Then $i_cols = $i_col Next Local $i_rows = $trs.length If $i_cols = 0 Or $i_cols = 0 Then MsgBox(1, "Failure to make good array from table", "Column count=" & $i_cols & "  Row count =" & $i_cols ) ;======== end of , find array problems Else $aTableData = _IETableWriteToArray($oTable) _ArrayDisplay($aTableData, "Table #" & $iIndex) $iIndex += 1 EndIf next EndFunc


Thanks!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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