Jump to content
Sign in to follow this  
Tripoz

How to detect IE page n refresh it?

Recommended Posts

Tripoz

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

Share this post


Link to post
Share on other sites
Tripoz

Translation.

n = and

pls = please

thx = thanks

lol...thx johnOne.

 

Share this post


Link to post
Share on other sites
mikell

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.

 

  
  

Share this post


Link to post
Share on other sites
Tripoz

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

Share this post


Link to post
Share on other sites
mikell

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)

 

Share this post


Link to post
Share on other sites
Tripoz

_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

Share this post


Link to post
Share on other sites
jvds

and why not _IEAttach and then _IEAction($oIE,"refresh")?
and i think _IENavigate($URL) to the same url could also work as a refresh

Share this post


Link to post
Share on other sites
Tripoz

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

Share this post


Link to post
Share on other sites
Tripoz

Glad to help you.

In #7, I gave you the same answer...

Yeap..before i just know _ieattach with kind of "url" n not realize that the title of the page could help me.

Thx once again

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  

×