Jump to content
UBot Underground

Navigating to the end of the page


Recommended Posts

Hi I have been searching the forums, google and the uBot support docs for this for a while now with no success.

 

I am working on a bot for a webpage that loads x number of profiles on the page. If there are more profiles than fit on one page, when you get to the bottom of the page, the page pauses and loads another batch of profiles, and so on until they are all loaded.

 

I was looking for a quick way to have the browser go the end of the page.

 

The question I have is: Can I send either the END key or the PAGEDOWN key somehow so that bot goes right to the bottom of the page? I have been trying to teach myself javascript to do this for the last couple hours with no love and am guessing the syntax might be something really easy...

 

Can anyone point me in the right direction on this one?

Link to post
Share on other sites

Thanks, I actually put that into the bot and it works to some degree. The problem I am having is the number of loops to run it is dependent on the number of profiles for given user. Some user might have 6 profiles and some might have 2000.

 

I was hoping to just navigate to the end of the page because when you go to the end of the page directly while it is loading the next batch of profiles, an element appears that I could then use to wait on or do an if exists to either continue or stop the process...

Link to post
Share on other sites

Got it! What I did to solve it was to create a variable using the scraped number of profiles associated with the user and then dividing that number by the number of profiles that load per page. Then I used this resulting variable value as the number of times to loop - using an wait not exist on the element that appears while the page is loading.

 

Seems to be working so far!

 

Edit to add: To consistently get to the bottom of a page, I simply changed the number of lines in the above script to be an insanely large number (like one million). It immediately goes to the end of the page no matter how long it is.

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