semenoffalex 0 Posted September 11, 2013 Report Share Posted September 11, 2013 Hi, all. I need to scrape results from a page, that load necessary elements on scrolling. I know the id of the element, that appears at the bottom of the page after several "scrolls", so it seems to me, that I should use "run javascript", "wait for an element" or "focus". However, I've tried several receipts from this forum, but none of them worked. In particular, I've tried the script window.scrollTo(0,document.body.scrollHeight); which was suggested several times in this forum (here, here and here). It didn't help. I saw neither scrolling no parsed elements. More sophisticated trick based on the same idea didn't work either. Here it is: loop(100) {wait(1)run javascript("window.scrollBy(0,50); // horizontal and vertical scroll incrementsscrolldelay = setTimeout(\'pageScroll()\',100); // scrolls every 100 milliseconds")wait(1)} I've found a mention of a method scrollIntoView()from this comment on StackOverflow, but I'm not sure how to implement it in Ubot. Can anyone help me? Quote Link to post Share on other sites
Ptrick125 45 Posted September 12, 2013 Report Share Posted September 12, 2013 (edited) This is the exact code I used in one of my bots: (Just copy and paste it ) run javascript("window.scrollBy(0,500); // horizontal and vertical scroll increments scrolldelay = setTimeout(\'pageScroll()\',100); // scrolls every 100 milliseconds") Edited September 12, 2013 by ptrick125 1 Quote Link to post Share on other sites
semenoffalex 0 Posted September 19, 2013 Author Report Share Posted September 19, 2013 (Just copy and paste it )run javascript("window.scrollBy(0,500); // horizontal and vertical scroll incrementsscrolldelay = setTimeout(\'pageScroll()\',100); // scrolls every 100 milliseconds") I'm not sure, where to copy/paste that, so I've done it this way (see attachment): An it still doesn't work Maybe I was following the advices about JavaScript wrong way all the time? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.