Herb191 Posted May 8, 2011 Share 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) Link to comment Share on other sites More sharing options...
wakillon Posted May 8, 2011 Share 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 Link to comment Share on other sites More sharing options...
wakillon Posted May 8, 2011 Share 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 Link to comment Share on other sites More sharing options...
Herb191 Posted May 8, 2011 Author Share 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. Link to comment Share on other sites More sharing options...
wakillon Posted May 8, 2011 Share 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 Link to comment Share on other sites More sharing options...
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