Jump to content
UBot Underground

Stop scrolling to the end of the page.


Recommended Posts

Hi Guys!

Could you help me with an ideea, how can i stop a loop if javascript scrolldown is ended?

I am talking about this window.scrollTo(0,document.body.scrollHeight);

I have a loop that i give a value=100, to scroll to the page and collect some information. I have a problem when some pages have 10scrolls, and some have 100scrolls.

There is any way to stop and go to next navigation, if the scroll is ended, or if listtotal is the same value for 2 times?

 

 

Thank you!

Link to post
Share on other sites

yes, just scrape the objects which appear when you scroll and compare list size before scroll and after scroll - if after the scroll and scrape you have same list, then no new items appear after the scroll so no point to scroll again.

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