How to click on specified text...
-
- Posts: 26
- Joined: 02 Apr 2016, 05:53
How to click on specified text...
Hi!
According to the image, I want the "Add to Cart" button to be pressed/clicked automatically as it appears, no matter where, and how many....
Please provide me the code to search for specified text and get it clicked...
Re: How to click on specified text...
ImageSearch
Searches a region of the screen for an image.
ImageSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ImageFile
https://ahkde.github.io/docs/frame.htm# ... Search.htm
other exanoles of using: https://github.com/sl5net/global-Intell ... ns.inc.ahk
Searches a region of the screen for an image.
ImageSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ImageFile
https://ahkde.github.io/docs/frame.htm# ... Search.htm
other exanoles of using: https://github.com/sl5net/global-Intell ... ns.inc.ahk
github>g_IntelliSense + next improvements + forum
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
-
- Posts: 26
- Joined: 02 Apr 2016, 05:53
Re: How to click on specified text...
Thanks for the reply, the button is not an image, it's text format, "Add to Cart" can be found as text, so I was searching something like seeking for the particular word and click on that found area...
Re: How to click on specified text...
its a webpage? maybe use com, it can do the job fastVISHALVODRO wrote:Thanks for the reply, the button is not an image, it's text format, "Add to Cart" can be found as text, so I was searching something like seeking for the particular word and click on that found area...
-
- Posts: 26
- Joined: 02 Apr 2016, 05:53
Re: How to click on specified text...
Dear, can you give me sort of example related to that?TinyDancer wrote:its a webpage? maybe use com, it can do the job fastVISHALVODRO wrote:Thanks for the reply, the button is not an image, it's text format, "Add to Cart" can be found as text, so I was searching something like seeking for the particular word and click on that found area...
Yes, it's Amazon, I'm trying to catch the lightning deals...
Re: How to click on specified text...
post a sample urlVISHALVODRO wrote:Dear, can you give me sort of example related to that?TinyDancer wrote:its a webpage? maybe use com, it can do the job fastVISHALVODRO wrote:Thanks for the reply, the button is not an image, it's text format, "Add to Cart" can be found as text, so I was searching something like seeking for the particular word and click on that found area...
Yes, it's Amazon, I'm trying to catch the lightning deals...
-
- Posts: 26
- Joined: 02 Apr 2016, 05:53
Re: How to click on specified text...
https://www.amazon.in/gp/goldbox/all-de ... a,b11a9b56TinyDancer wrote:post a sample urlVISHALVODRO wrote:Dear, can you give me sort of example related to that?TinyDancer wrote:its a webpage? maybe use com, it can do the job fastVISHALVODRO wrote:Thanks for the reply, the button is not an image, it's text format, "Add to Cart" can be found as text, so I was searching something like seeking for the particular word and click on that found area...
Yes, it's Amazon, I'm trying to catch the lightning deals...
Check out the link, I want AHK to press those "Add to Cart" button automatically...
Thanks dear
Re: How to click on specified text...
Here is the code for that page, I included some notes. Because you never know how many add to cart buttons there will be we must do a loop to first check how many buttons are there, then, the system goes to the buttons and clicksVISHALVODRO wrote:https://www.amazon.in/gp/goldbox/all-de ... a,b11a9b56TinyDancer wrote:post a sample urlVISHALVODRO wrote:Dear, can you give me sort of example related to that?TinyDancer wrote:its a webpage? maybe use com, it can do the job fastVISHALVODRO wrote:Thanks for the reply, the button is not an image, it's text format, "Add to Cart" can be found as text, so I was searching something like seeking for the particular word and click on that found area...
Yes, it's Amazon, I'm trying to catch the lightning deals...
Check out the link, I want AHK to press those "Add to Cart" button automatically...
Thanks dear
you might be able to remove or you might need to add some more or less sleep
also for now i have it set to show you the browser window, but you can change it on line 2, the messagebox at end you dont need its just there to test to make sure the program picks up how many buttons we have
Code: Select all
pwb := ComObjCreate("InternetExplorer.Application")
pwb.Visible := True ; change to False to hide IE window
pwb.Navigate("https://www.amazon.in/gp/goldbox/all-deals?ie=UTF8&gb_edi=c0e585ea,b11a9b56")
while pwb.ReadyState != 4
sleep, 1000
sleep, 2500
amazon1 .= pwb.document.getElementsByTagName("BUTTON").length
loop, %amazon1%{
amazon2 .= pwb.document.getElementsByTagName("BUTTON")[ A_index -1 ].Click() "`n"
;sleep, 3000 ; you might need this for the page to work
}
msgbox, Clicked on %amazon1% Buttons
pwb.quit()
-
- Posts: 26
- Joined: 02 Apr 2016, 05:53
Re: How to click on specified text...
Dear,
Thank for your effort and support.
I don't want the script to open the link itself, it just needs to work upon running the file.
Now it opens by default on IE Browser which doesn't seem to be working well, if it opens on chrome, works better.
Thanks in advance...
Thank for your effort and support.
I don't want the script to open the link itself, it just needs to work upon running the file.
Now it opens by default on IE Browser which doesn't seem to be working well, if it opens on chrome, works better.
Thanks in advance...
Re: How to click on specified text...
To work with chrome you will need to use this https://autohotkey.com/boards/viewtopic.php?f=6&t=42890VISHALVODRO wrote:Dear,
Thank for your effort and support.
I don't want the script to open the link itself, it just needs to work upon running the file.
Now it opens by default on IE Browser which doesn't seem to be working well, if it opens on chrome, works better.
Thanks in advance...
I am not familiar with chrome fore automation
If all the buttons are visible on the screen and you dont have to scroll, you can use image search and that will work on any browser but the screen must be active and the buttons visible
Who is online
Users browsing this forum: mikeyww and 315 guests