Jump to content

String button click


Recommended Posts

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 ? 

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

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