Jump to content

How to detect IE page n refresh it?


Recommended Posts

hi, i got some problem to detect IE page/title that already exist..

if the page is not exist, it can create a new page, but if already exist..its can detect but cant refresh it.

can anybody help me please...thanks

my code:

#include <IE.au3>

while 1
   sleep(2000)
   bacareturn()
WEnd


Func bacareturn()
local $oIE,$oIE1
Local $Span
local $URL ="https://www.xxxxx.com"
   If Not WinExists("Title Page - Windows Internet Explorer") Then
       $oIE = _IECreate($URL)
       consolewrite("web no exist, create new")
    Else
      $oIE = _IEAction($oIE,"refresh")
      consolewrite("web is already exist n refreshed")

   EndIf
EndFunc

 

Edited by Tripoz
translation
Link to comment
Share on other sites

lol = :D
n you shoud say : thx JO

Have a look at _IEPropertyGet and these properties
"locationname" Retrieves the name of the resource that Internet Explorer is currently displaying.
"locationurl" Retrieves the URL of the resource that Internet Explorer is currently displaying.

 

  
  
Link to comment
Share on other sites

lol = :D
n you shoud say : thx JO

Have a look at _IEPropertyGet and these properties
"locationname" Retrieves the name of the resource that Internet Explorer is currently displaying.
"locationurl" Retrieves the URL of the resource that Internet Explorer is currently displaying.

 

  
  

more confused...lol.. theres no example for that properties in help file..:(

Link to comment
Share on other sites

_IEAttach should also help you

yes ieattach could help me..but i need to refresh the web after attach it ( to grab some new data), because if just Attach it, the data still not change on the webpage so i must refresh it after attach it.

 

So don't be shy and build your own example  ;)

#include <IE.au3>

$oIE = _IECreate("http://www.google.com")
$current_url = _IEPropertyGet($oIE, "locationurl")
$oIE.visible = 0
Msgbox(4096,"locationUrl", $current_url)

 

hmm...that i dont know is what relation between locationurl/locationname with refresh the page..??

please explain to me cause i need to know so in other day i willnt askin same question again..:)

 

heres the solved code for my question (inspired by mikell code)..lol...thx so much mikell

#include <IE.au3>

$oIE = _IECreate("http://www.google.com")
$current_url = _IEPropertyGet($oIE, "locationurl")
_IEAction($oIE,"refresh")

 

Edited by Tripoz
solved
Link to comment
Share on other sites

@mikell

1 more question, how to detect it if it opened or not?

i trying something like this n got error :

#include <IE.au3>

If Not WinExists("Google - Windows Internet Explorer") Then
$oIE = _IECreate("http://www.google.com")
Else
   $current_url = _IEPropertyGet($oIE, "locationurl")
   _IEAction($oIE,"refresh")
EndIf

if it opened, i dont want to create a new one..just refresh.

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...