Jump to content

Save IE URL from Address Bar


Recommended Posts

I'm in the process of learning AutoIT, but I'm a bit stuck. I have the original link save in a string, open an IE window, log in, etc. Once you log in, the url name changes accordingly with a random string now in the url to track your usage. I need a way to get that URL, save it in a string, and the change it to do a specific logout function. Basically the question is, how do I save that URL. I tried _IEPropertyGet, but that requires you to have an object (which I think is the original $oIE link that I created). Any help is appreciated. Thanks.

-Work Smarter, Not Harder, Use More AutoIT

Link to comment
Share on other sites

i think it could be the $oIE var that u use in IEPropertyGet but i'm not sure. try:

"locationurl" Retrieves the URL of the resource that Internet Explorer is currently displaying.

Another way of getting the url while the window is open is to do alt + d, then cut it, and save it.

Link to comment
Share on other sites

You can use _IEAttach to get an object reference to an existing browser.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks for all the helps guy. Fast responses are truly appreciated. I finally did get it. I was opening the IE window incorrectly and didn't have a sleep command in there to give the page time to load.

Dim $addressbar = ""

$addressbar = _IEPropertyGet($StudySite, "locationurl")

MsgBox(4096, "Title", $addressbar) ;display the address found

That's how I got it to work.

Thanks again.

-Work Smarter, Not Harder, Use More AutoIT

Link to comment
Share on other sites

Thanks for all the helps guy. Fast responses are truly appreciated. I finally did get it. I was opening the IE window incorrectly and didn't have a sleep command in there to give the page time to load.

Dim $addressbar = ""

$addressbar = _IEPropertyGet($StudySite, "locationurl")

MsgBox(4096, "Title", $addressbar) ;display the address found

That's how I got it to work.

Thanks again.

This is an actual extension of the original problem. I saved the original and changed it to what i need it to be in $StringAddress. Now I need to paste that string into the URL address bar and go to that new site. How is this accomplished?

Thanks again for any help

-Work Smarter, Not Harder, Use More AutoIT

Link to comment
Share on other sites

You might also want to take a look at using te keyboard shortcuts that are already built into IE

ALT+D selects the text in the address bar.

Edit:

The full list of shortcuts for IE7 can be found here

http://dundats.mvps.org/Internet/InternetE.../IE7_keybrd.htm

Most also apply to previous versions of IE

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

If using IE.au3, use _IENavigate

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 4 years later...

I know the last reply on this topic was (almost exactly) 5 years ago, but I post this for everyone who, like me, stumbles upon this topic, trying to find a way to read the IE adress bar. This works just fine for me:

ControlGetText("[CLASS:IEFrame]", "", "Edit1")

Used with MsgBox to see the effect:

MsgBox(0, "", ControlGetText("[CLASS:IEFrame]", "", "Edit1"))

Hope this will be of use to someone. ;-)

Link to comment
Share on other sites

  • 2 months later...

SOry for newbie question. I want write addres after function into my text file.

$url_aktualny = ("$function_reading_http_addres_from_$oie")
$url = ("url.txt")
FileWrite($url, $url_aktualny)

Which command to read the value that was saved by the form of http:// or www.

And IE window:

Local $oIE = _IECreateEmbedded()

Just don't want spam with new topic :)

Edited by mojehyip
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...