Sign in to follow this  
Followers 0
sosimple

IELinkClickByText help

9 posts in this topic

Hi

I write this

#include <IE.au3>

$O_IE=_IECreate ("http://www.autoitscript.com/forum")

_IECreate ("http://www.autoitscript.com/forum")

sleep(1000)

_IELinkClickByText($O_IE, "General Help and Support")

It opens the internet explorer, the page http://www.autoitscript.com/forum and then it stops.

It supposed to redirect to page General Help and Support but it doesnt . Why?

I also used this

#include <IE.au3>

_IECreate ("http://www.autoitscript.com/forum")

_IELinkClickByText($oIE, "General Help and Support")

It also doesnt work. Any idea what i am doing wrong?

Thanks ,

Share this post


Link to post
Share on other sites



Hi

I write this

#include <IE.au3>

$O_IE=_IECreate ("http://www.autoitscript.com/forum")

_IECreate ("http://www.autoitscript.com/forum")

sleep(1000)

_IELinkClickByText($O_IE, "General Help and Support")

It opens the internet explorer, the page http://www.autoitscript.com/forum and then it stops.

It supposed to redirect to page General Help and Support but it doesnt . Why?

I also used this

#include <IE.au3>

_IECreate ("http://www.autoitscript.com/forum")

_IELinkClickByText($oIE, "General Help and Support")

It also doesnt work. Any idea what i am doing wrong?

Thanks ,

This works...

#include <IE.au3>

$delay = 0
$wait = 5000


$sURL = "http://www.autoitscript.com/forum/index.php?"
$oIE = _IECreate($sURL, 0, 0, 0)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")
_IELoadWait($oIE, $delay, $wait)


_IELinkClickByText($oIE, "General Help and Support")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#include <IE.au3>
$O_IE=_IECreate ("http://www.autoitscript.com/forum")
_IECreate ("http://www.autoitscript.com/forum")
sleep(1000)
_IELinkClickByText($O_IE, "General Help and Support")

It opens the internet explorer, the page http://www.autoitscript.com/forum and then it stops.

It supposed to redirect to page General Help and Support but it doesnt . Why?

The simple answer is, you've created TWO windows with the same address and different object handles, and IE.au3 is somewhat confused as to which one you actually want to manipulate.

#include <IE.au3>
_IECreate ("http://www.autoitscript.com/forum")
_IELinkClickByText($oIE, "General Help and Support")
With this one, it's trying to click the link far to quickly. A simple _IELoadWait() between the Create and the Click would work, or better yet,

$oIE = _IECreate ("http://www.autoitscript.com/forum", 1, 1, 1) ; note the use of the flags after the address.
If @error Then
   MsgBox(0, "", "Error creating the web page!")
   Exit
EndIf
_IELinkClickByText($oIE, "General Help and Support")
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

This works...

#include <IE.au3>

$delay = 0
$wait = 5000
$sURL = "http://www.autoitscript.com/forum/index.php?"
$oIE = _IECreate($sURL, 0, 0, 0)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")
_IELoadWait($oIE, $delay, $wait)
_IELinkClickByText($oIE, "General Help and Support")

Ok this one works for me! Thanks.

Now, if i wanted to do all this in the backround , (i want all the process to be invisible) is there anything to do?

Why?

Well what i really want to do, is go to a site, and download a file. The site has redirection protection, so I canot write for example www.mysite.com/myfile.rar

but i have to go to www.mysite.com and then use _IELinkClickByText($oIE, "myfile") , which is what you have created and work. It bypass the redirection problem.

What i now want to do, is to done the above without to see it on the scrreen. ( I also have the problem that when the script is working, it ends, with the window of the internet explorer, asking me if i want to open the file with winrar or save it to hard disc. Is there any command to automate this, so the internet explorer stops asking me this and save the file to c:/downloads/ ? )

Thanks , and please help again!

Share this post


Link to post
Share on other sites

Now, if i wanted to do all this in the backround , (i want all the process to be invisible) is there anything to do?

$oIE = _IECreate ("http://www.autoitscript.com/forum", 1, 0, 1) ; note the use of the flags after the address.

Read the help file for _IECreate. It's all there.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

$oIE = _IECreate ("http://www.autoitscript.com/forum", 1, 0, 1) ; note the use of the flags after the address.

Read the help file for _IECreate. It's all there.

Ok thanks, this helped alot. I did all the process invisimple, until the window of the internet explorer, asking me if i want to open the file with winrar or save it to hard disc. Perhaps the unsuer is om the help file, but I cant find it as i amm newbee on autoit3. Can anyone help?

What I now want to do is ,as i was writing before , the internet explorer to stops asking me if i wanted to open the file with winrar or save it to hard disc. I want to save the file to c:/downloads.

This is my script until now

#include <IE.au3>

$delay = 0

$wait = 5000

$sURL = "http://www.mysite.com/"

$oIE = _IECreate($sURL, 1, 0, 1)

$HWND = _IEPropertyGet($oIE, "hwnd")

WinSetState($HWND, "", @SW_HIDE)

_IEAction($oIE, "invisible")

_IELoadWait($oIE, $delay, $wait)

_IELinkClickByText($oIE, "Download")

Share this post


Link to post
Share on other sites

See the second example in the helpfile for _IEAction


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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

#include <IE.au3>
$delay = 0
$wait = 5000
$sURL = "http://www.mysite.com/"
$oIE = _IECreate($sURL, 1, 0, 1)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_HIDE)
_IEAction($oIE, "invisible")
_IELoadWait($oIE, $delay, $wait)
_IELinkClickByText($oIE, "Download")

Ok, you've hidden the same window three times in 10 lines.

O.o

... and $delay, $wait, and $sURL are ... for the most part ... unneccessary.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

I dont know how to write it better. It works ok for me , i know its not the best way. Any idea to do the rest i ask?

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