Shizu

String button click

7 posts in this topic

#1 ·  Posted

Hello.

 

I have small problem. I want to navigate internet explorer using <IE.au3> to click the button. I do not know what's the href or any other destination information. I just know how the button will be called for example :

I want IE to open any site, then click the link called "NEW ARTICLES"(not a graphic button, just a hyperlink). 

 

Is it possible to do something like this ? 

Share this post


Link to post
Share on other sites



#2 ·  Posted

@Shizu welcome to the forum. You are not going to be able to "open any site" and click the button the same, as the button is not going to be coded exactly the same on every site. Your best bet is to look through the help file and the _IE* functions, try the examples contained therein on a specific website you would like to automate. Then, if you run into trouble, post your code and we will do our best to assist.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

Here is a really basic example to get you started:

#include <IE.au3>

Local $sURL = "https://www.autoitscript.com/autoit3/docs/libfunctions/_IELinkGetCollection.htm"
Local $oIE = _IECreate($sURL)
Local $oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    If StringStripWS($oLink.InnerText, 7) = "_IEAction()" Then
        _IEAction($oLink, "Click")
        ExitLoop
    EndIf
Next

 

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

For example: 

I want to open site ebay(I know how to do it) and then click the hyperlink  Brighten Up (http://imgur.com/a/U65Yo). I do not want to use the source of it

Quote

<a href="http://www.ebay.com/cln/decouverte/brighten-up/392994973019" _sp="p2057337.m2572.l4724" title="Collection of products named Brighten Up">Brighten Up</a>

. I want autoit to search for the string Brighten Up and then save it to variable or click it directly. Is it possible ? Any specific command of _IE ? 

Thanks for replies. 

Edited by Shizu

Share this post


Link to post
Share on other sites

#5 ·  Posted

The example I posted does exactly this, did you test, the example above goes to the url 

"https://www.autoitscript.com/autoit3/docs/libfunctions/_IELinkGetCollection.htm"

It then searches all links for the word "_IEAction": 

;~ Search for the word "_IEAction()"
If StringStripWS($oLink.InnerText, 7) = "_IEAction()" Then

It then clicks that link

Share this post


Link to post
Share on other sites

#6 ·  Posted

Following JLogan's recommendations you would have found in the helpfile something named  _IELinkClickByText ...

Share this post


Link to post
Share on other sites

#7 ·  Posted

Thank you guys, I'll try it soon. If I have any more questions I'll ask you in this topic, so do not close it if possible. Cheers.

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