Sign in to follow this  
Followers 0
Herb191

Stop automatic page refresh after _IECreate

5 posts in this topic

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



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.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

hum....like this, no refresh ! Posted Image

#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 by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

hum....like this, no refresh ! Posted Image

You were to fast for me I was working on your first post:

#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

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 ! Posted Image

Glad to help you !


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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