Jump to content

Stop automatic page refresh after _IECreate


Recommended Posts

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

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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...