Jump to content
UBot Underground

How do you click this button?


Recommended Posts

I keep trying to click this button on Amazon but it never seem to react, only when I click on the window or scroll down will it react to the click. very weird, I don't see any javascript either. Here's the sample bot. Can anybody help? Thanks!

 

 

amazon next button.ubot

post-1039-0-92538600-1370947363_thumb.jpg

Edited by panoz
Link to post
Share on other sites

is img recognition available in v3.5? if it is, then I think you can use it to click the buttons

 

this is the code that I used in v4 to make it work:

click(<innerhtml="
        <span class=\"bg-text\">Back</span>
        <span class=\"bg-image\" title=\"Back\"></span>
        ">, "Left Click", "No")
click(<innerhtml="
        <span class=\"bg-text\">Next</span>
        <span class=\"bg-image\" title=\"Next\"></span>
        ">, "Left Click", "No")

the code is for the back button and for the next button, I think that you can use the tags in your click event in v3.5

Link to post
Share on other sites

It's not easy to select element or "choose by attribute" for scraping like in v3.5 that's why I opted to use v3.5, what tags element are you refering to?

is img recognition available in v3.5? if it is, then I think you can use it to click the buttons

 

this is the code that I used in v4 to make it work:

click(<innerhtml="
        <span class=\"bg-text\">Back</span>
        <span class=\"bg-image\" title=\"Back\"></span>
        ">, "Left Click", "No")
click(<innerhtml="
        <span class=\"bg-text\">Next</span>
        <span class=\"bg-image\" title=\"Next\"></span>
        ">, "Left Click", "No")

the code is for the back button and for the next button, I think that you can use the tags in your click event in v3.5

Link to post
Share on other sites

is img recognition available in v3.5? if it is, then I think you can use it to click the buttons

 

this is the code that I used in v4 to make it work:

click(<innerhtml="
        <span class=\"bg-text\">Back</span>
        <span class=\"bg-image\" title=\"Back\"></span>
        ">, "Left Click", "No")
click(<innerhtml="
        <span class=\"bg-text\">Next</span>
        <span class=\"bg-image\" title=\"Next\"></span>
        ">, "Left Click", "No")

the code is for the back button and for the next button, I think that you can use the tags in your click event in v3.5

 

I'm being a noob. How do I enter this code into ubot v4? I can't seem to get it to work. Here's what I'm doing:

post-1039-0-00969800-1371117196_thumb.jpg

Link to post
Share on other sites

try this code :

set(#URL, "http://www.amazon.com/Apple-iPhone-16GB-Black-Verizon/dp/B004ZLV5UE/ref=sr_1_1?s=wireless&ie=UTF8&qid=1371147950&sr=1-1", "Global")
navigate(#URL, "Wait")
wait for browser event("Page Loaded", "")
wait for element(<id="purchaseShvl">, "", "Appear")
loop(5) {
    comment("Back button")
    click(<class="auiTestSprite s_shvlBack">, "Left Click", "No")
    wait(1)
}
comment("Next Button")
click(<class="auiTestSprite  s_shvlNext">, "Left Click", "No")

  • Like 1
Link to post
Share on other sites

nnavigate("http://www.amazon.com/Apple-iPhone-16GB-Black-Verizon/dp/B004ZLV5UE/ref=sr_1_1?s=wireless&ie=UTF8&qid=1371147950&sr=1-1", "Wait")
loop(20) {
    run javascript("window.scrollBy(0,50); // horizontal and vertical scroll increments
scrolldelay = setTimeout(\'pageScroll()\',.1000);")
    wait(.100)
}
wait for element(<href="#Next">, "", "Appear")
wait for element(<innertext=w"Page 1 of *">, "", "Appear")
loop($subtract($trim($scrape attribute(<class="num-pages">, "innertext")), 1)) {
    click(<href="#Next">, "Left Click", "No")
    wait(1)
}
  • Like 1
Link to post
Share on other sites

ok, I just pasted these code directly into code view as it appears, but the bot won't save or let me view by node view for me to make edits. Is there something that I'm missing?

Link to post
Share on other sites
nnavigate("http://www.amazon.com/Apple-iPhone-16GB-Black-Verizon/dp/B004ZLV5UE/ref=sr_1_1?s=wireless&ie=UTF8&qid=1371147950&sr=1-1", "Wait")
loop(20) {
    run javascript("window.scrollBy(0,50); // horizontal and vertical scroll increments
scrolldelay = setTimeout(\'pageScroll()\',.1000);")
    wait(.100)
}
wait for element(<href="#Next">, "", "Appear")
wait for element(<innertext=w"Page 1 of *">, "", "Appear")
loop($subtract($trim($scrape attribute(<class="num-pages">, "innertext")), 1)) {
    click(<href="#Next">, "Left Click", "No")
    wait(1)
}

Thanks! I'll give it a go, I think your code might work, because it won't register the click if there was no movement on the page (very weird)

Link to post
Share on other sites

ok, I just pasted these code directly into code view as it appears, but the bot won't save or let me view by node view for me to make edits. Is there something that I'm missing?

Nevermind, got it to work, there was an extra n in navigate at the very beginning.

 

And the script works, thanks a million!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...