![Image](https://i.imgur.com/frAZGs8.png)
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...
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...
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...
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...
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...
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
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()
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...
Users browsing this forum: mstrauss2021, peter_ahk, Spawnova, zephyrus2706 and 354 guests