Jump to content
UBot Underground

Problem To Scroll With "run Javascript"


Recommended Posts

Hello everybody,

 

I'm confront to one problem.

 

By habit, i use a command javascript on "run javascript" to scroll my page.

 

However, on the site where i develop my bot the javascript command no word.

 

i have think at the command "jquery" assumption. does it work with ubot?

 

i have find this on stackoverflow:

 

   $('html, body').animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
});
 
Could someone help me please, because I tear my hair :)
 
Thank you by advance

 

Link to post
Share on other sites

divider
define log {
    clear cookies
    set user agent("Chrome")
    navigate("http://www.twitch.tv/","Wait")
    wait for element(<innertext="Log In">,"","Appear")
    click(<login link>,"Left Click","No")
    wait for element($element offset(<username field>,0),"","Appear")
    type text($element offset(<username field>,0),"USERNAME","Standard")
    wait for element($element offset(<username field>,0),"","Appear")
    type text($element offset(<password field>,0),"PASSWORD","Standard")
    wait for element(<login button>,"","Appear")
    click(<login button>,"Left Click","No")
}
define search channel cible {
    navigate("http://www.twitch.tv/directory/game/Callof Duty: Advanced Warfare" ,"Wait")
    wait for browser event("Everything Loaded","")
}
divider
log("")
wait for element(<id="frontpage_player_container">,"","Appear")
click(<class="noty_close">,"Left Click","No")
search channel cible()
click(<id="right_close">,"Left Click","No")
run javascript("")

Link to post
Share on other sites

Hi

 

the code you have is wrong it should have no }) at the end,which causes an error,jquery does work with ubot as it is just javascript,but the page does need jquery,assuming it does this will work,keep the # in the code below,and replace elementtoScrollToID with the id,put that into the run javascript command

 

$('html, body').animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
 
if it doesn't have jquery,run this code below after the page loads first,so the page is injected with jquery
 
 
 
run javascript("var myScript = document.createElement(\"script\")
myScript.src = \"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"

document.body.appendChild(myScript)")
    wait(1.2)
Link to post
Share on other sites
Deliter is very good professional. He has develop for me a good scraper bot with api twitch in 2 hours. Thank you so much for your help.

:) :) :) Price correct and very good job. I recommend :) :) :)

  • Like 1
Link to post
Share on other sites
  • 1 month later...

Just wanted to say that I highly recommend Deliter too!  His profile - http://network.ubotstudio.com/forum/index.php/user/15170-deliter/

 

He just created a bot for me and it works great. He is very helpful and really works to understand the requirements of the project.

 

Then he was willing to tweak things to make the bot perfect.

 

THEN, he made the bot run even faster without my requesting it!  

 

That's OVER delivering.

 

Highly recommend, Deliter!

  • Like 1
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...