Herb191 4 Posted May 8, 2011 How do I stop a webpage from automatically refreshing when I am collecting its tag names? Here is what I have been trying: #Include <Array.au3> #include <IE.au3> $oIE = _IECreate("http://quotes.ino.com/exchanges/?r=NYMEX_CL", 0, 1) $oElements = _IETagNameAllGetCollection($oIE) _IEAction ($oIE, "stop") ;does not seem to help If IsObj($oElements) Then Dim $tag_structure_pattern[1] For $oElement In $oElements $element_tag_name = $oElement.tagname ConsoleWrite("Adding tag:" & $element_tag_name & @CRLF) _ArrayAdd($tag_structure_pattern, $element_tag_name) Next Else ConsoleWrite("Not an object!" & @CRLF) EndIf _IEQuit($oIE) _ArrayDisplay($tag_structure_pattern) Share this post Link to post Share on other sites
wakillon 403 Posted May 8, 2011 Use _IEBodyReadHTML for save to an html file and re-open it like this $sURL = "file:///" & @DesktopDir & "\source.html" $oIE= _IECreate ( $sURL ) ... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
wakillon 403 Posted May 8, 2011 (edited) hum....like this, no refresh ! #Include <Array.au3> #include <IE.au3> $oIE = _IECreate ( "http://quotes.ino.com/exchanges/?r=NYMEX_CL", 0, 1 ) $sHTML = _IEBodyReadHTML ( $oIE ) FileWrite ( @DesktopDir & "\source.html", $sHTML ) _IENavigate ( $oIE, "file:///" & @DesktopDir & "\source.html" ) $oElements = _IETagNameAllGetCollection($oIE) If IsObj($oElements) Then Dim $tag_structure_pattern[1] For $oElement In $oElements $element_tag_name = $oElement.tagname ConsoleWrite("Adding tag:" & $element_tag_name & @CRLF) _ArrayAdd($tag_structure_pattern, $element_tag_name) Next Else ConsoleWrite("Not an object!" & @CRLF) EndIf _IEQuit($oIE) _ArrayDisplay($tag_structure_pattern) Edited May 8, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
Herb191 4 Posted May 8, 2011 hum....like this, no refresh ! You were to fast for me I was working on your first post: expandcollapse popup#Include <Array.au3> #include <IE.au3> $oIE = _IECreate("http://quotes.ino.com/exchanges/?r=NYMEX_CL", 0, 1) $html = _IEBodyReadHTML($oIE) $file = FileOpen("temp_page.html", 2) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $html) FileClose($file) $sURL = "file:///" & @ScriptDir & "\temp_page.html" _IENavigate($oIE, $sURL) $oElements = _IETagNameAllGetCollection($oIE) _IEAction ($oIE, "stop") If IsObj($oElements) Then Dim $tag_structure_pattern[1] For $oElement In $oElements $element_tag_name = $oElement.tagname ConsoleWrite("Adding tag:" & $element_tag_name & @CRLF) _ArrayAdd($tag_structure_pattern, $element_tag_name) Next Else ConsoleWrite("Not an object!" & @CRLF) EndIf _IEQuit($oIE) _ArrayDisplay($tag_structure_pattern) Thanks for the help. Share this post Link to post Share on other sites
wakillon 403 Posted May 8, 2011 You were to fast for me I was working on your first post:Thanks for the help.That's because you have blocked the refresh on your browser ! Glad to help you ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites