Sign in to follow this  
Followers 0
Sarah

Get URL

10 posts in this topic

I've been toying with the IE library and do like it. One question:

How can I get the current URL from an IE window ?

_IEGetURL($o_object) doesn't seem to exist :">

Thanks for any hints;

Share this post


Link to post
Share on other sites



I've been toying with the IE library and do like it. One question:

How can I get the current URL from an IE window ?

_IEGetURL($o_object) doesn't seem to exist :">

Thanks for any hints;

Maybe iegetproperty: locationurl? I see some things like that in the version of ie.au3 that I downloaded recently...

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

I've been toying with the IE library and do like it. One question:

How can I get the current URL from an IE window ?

_IEGetURL($o_object) doesn't seem to exist ': '>

Thanks for any hints;

Hmm, I look inside the UDF code and observe:

_IECreate - make an instance of your browser object

_IEAttach - attach to an existing browser object

_IENavigate - go to the url

_IEGetProperty - get properties such as address, url, etc (.LocationURL is the one I think you are looking for - use it as $o_object.LocationURL)

_IEQuit - close the browser object

It even has the reference to http://msdn.microsoft.com/library/default....netexplorer.asp inside the code.

Happy reading. ;)

Share this post


Link to post
Share on other sites

Thanks a lot, _IEGetProperty did the trick nicely.

Share this post


Link to post
Share on other sites

Sorry but I can find "_iEgetproperty" on help file?

Share this post


Link to post
Share on other sites

The function name is "_IEPropertyGet" not "_IEGetProperty". "_IEPropertyGet" can be found in the help file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Either way, ;) [frown] or :) [no frown]. Thanks for bumping as it put the answer at the top of the list.

Share this post


Link to post
Share on other sites

It exists in the Help file.

; *******************************************************
; Example 1 - Open a browser with the basic example, check to see if the
;   addressbar is visible, if it is turn it off, if it is not turn it on
; *******************************************************
#include <IE.au3>
Local $oIE = _IE_Example("basic")
If _IEPropertyGet($oIE, "addressbar") Then
 MsgBox(0, "AddressBar Status", "AddressBar Visible, turning it off")
 _IEPropertySet($oIE, "addressbar", False)
Else
 MsgBox(0, "AddressBar Status", "AddressBar Invisible, turning it on")
 _IEPropertySet($oIE, "addressbar", True)
EndIf
; *******************************************************
; Example 2 - Open a browser with the form example and get a reference to the form
;   textarea element.  Get the coordinates and dimensions of the text area,
;   outline its shape with the mouse and come to rest in the center
; *******************************************************
$oIE = _IE_Example("form")
Local $oForm = _IEFormGetObjByName($oIE, "ExampleForm")
Local $oTextArea = _IEFormElementGetObjByName($oForm, "textareaExample")
; Get coordinates and dimensions of the textarea
Local $iScreenX = _IEPropertyGet($oTextArea, "screenx")
Local $iScreenY = _IEPropertyGet($oTextArea, "screeny")
Local $iBrowserX = _IEPropertyGet($oTextArea, "browserx")
Local $iBrowserY = _IEPropertyGet($oTextArea, "browserY")
Local $iWidth = _IEPropertyGet($oTextArea, "width")
Local $iHeight = _IEPropertyGet($oTextArea, "height")
; Outline the textarea with the mouse, come to rest in the center
MouseMove($iScreenX, $iScreenY)
MouseMove($iScreenX + $iWidth, $iScreenY)
MouseMove($iScreenX + $iWidth, $iScreenY + $iHeight)
MouseMove($iScreenX, $iScreenY + $iHeight)
MouseMove($iScreenX, $iScreenY)
MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2)

I feel nothing.It feels great.

Share this post


Link to post
Share on other sites

Totally aware. I looked for 5 minutes in the help file, didn't see it and searched here for the answer. In no way would I have asked the OP question without a full search of all my resources.

Thanks for the additional links. I'm sure it will help others.

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