RK_0
(RK)
August 3, 2022, 6:17am
1
Hello Everyone,
I want to scroll down to bottom of a page with infinite scroll or scroll to load type page,
I was able to do with “hotkey”, its take 2-3 mins for 300 units of data,
So, is there is any method to scroll to bottom of page in less time or instantly,
Page is build using javascript, cannot share the page
Thanks in advacne
1 Like
Hi @RK_0
could you refer this link
Hi @sandeepbhutani304 ,
Kindly check the example attached, it basically inject a javascript that detects if it has reached the bottom and once it happens it shows a message. In this example, I used the follow settings:
Browser: Internet Explorer 11
URL: Google Search
Example.zip (4.0 KB)
[image]
also Hot key Ctrl +End will take you directly to the bottom of the page.
Thanks
1 Like
RK_0
(RK)
August 3, 2022, 6:30am
3
Thanks for the response,
Well, I already used the send hotkey, but the page is scroll to load , if use hotkey eg; end, it will only load another 10 units, next time 20 units
in the below image, I used end 2 times;
Gokul001
(Gokul Balaji)
August 3, 2022, 6:32am
4
Hi @RK_0
Have a look on the video link and thread
Hello,
I am new to UiPath and just getting started:
I would like to scrap data on an infinite scrolling page (the page keeps loading for new results when scrolling down to bottom of page).
Unfortunatly, the only answer I found about this topic is this one:
Please can somebody help me with a screenshot of a scenario ?
Thanks by advance,
Regards
Gokul
1 Like
Hello @RK_0
You can use it as a while loop with a combination of element exists and send hotkeys.
Element exists is to check for some element at the bottom of the page, if its false then do a sendhotkey down arrow.
so loop will continue till the bottom of the page.
Gokul001
(Gokul Balaji)
August 3, 2022, 6:33am
6
HI @RK_0
You can try with this to packages
Regards
Gokul
1 Like
RK_0
(RK)
August 3, 2022, 6:35am
7
Thank you for the support.
Cannot use these packages, i will the check posts you shared above
Thanks again,
1 Like
RK_0
(RK)
August 3, 2022, 6:37am
8
Thanks for the response.
Well, I already did that but, it consumes a lot of time,
Is there any other method which faster like that can be done in few seconds
Have you sued the Mouse scroll activity?
RK_0
(RK)
August 3, 2022, 6:39am
10
Well, i tried this activity, its asking for number of scroll, but number is dynamic as the data gets updated daily
jeevith
(Jeevith Hegde, Ph.D.)
August 3, 2022, 6:48am
11
Hi @RK_0 ,
One other UI alternative is
You identify the last item or bottommost element and Set Focus to it. It will instantly focus on that element in the browser (Scrolls down to the element automagically!). It may also need some checks either before or after so that you are sure that you are at the bottom of the page.
Invoke Javascript
I would look for ways to do it with Javascript (Invoke Javascript activity) with some checks either before or after the script runs to ensure that the end of the page is reached or not.
1 Like
RK_0
(RK)
August 3, 2022, 6:54am
12
Thanks for the response.
Is there any javascript/inject javascript to scroll down to the bottom of the page? If possible, please share.
Thanks again
jeevith
(Jeevith Hegde, Ph.D.)
August 3, 2022, 7:26am
13
Hi @RK_0 ,
There are approaches already available, you have to wrap them in your inject javascript activity and run it.
I like the one from “PixelsTech”
javascript - Scroll Automatically to the Bottom of the Page - Stack Overflow
window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight);
Here is an example with a long forum thread
Sample .xaml file
ScrollToBottomOfWebPage.xaml (19.1 KB)
The approach may need some edits as we do not know how your webpage looks like and how it would behave.
Hope this helps you and others.
1 Like
Hi @RK_0
Try the Inject JS script activity
"function(){
window.scrollTo(0, document.body.scrollHeight);}"
Indicate the browser screen on which you want to scroll to the bottom
1 Like
RK_0
(RK)
August 3, 2022, 7:37am
15
@kumar.varun2 @jeevith
Thanks for sending js, both worked but there is small issue,
this is before code;
after running js;
it scrolled only once and 547 is not constant; page is scroll to load data;
Each scroll will load new data
jeevith
(Jeevith Hegde, Ph.D.)
August 3, 2022, 7:46am
16
You can get 547 (or any dynamic number) text, convert to int, divide by 10, round it up to get how many times you need to loop.
In this case it will be 54 times.
For each Enumerable.Range(0,54)
Inject Javascript
In the end you can check if your Element reads for example 547/547
then you know the workflow did its job.
1 Like
RK_0
(RK)
August 3, 2022, 11:01am
17
Hi,
I tried with your instruction but im am not able to acheive it,
if possible can you share the javascript file
Thanks
jeevith
(Jeevith Hegde, Ph.D.)
August 3, 2022, 1:51pm
18
Hi @RK_0 ,
jeevith:
You can get 547 (or any dynamic number) text, convert to int, divide by 10, round it up to get how many times you need to loop.
You can achieve this by editing xaml file.
Here is the approach. Remember in your case you will have to extract the 547 value and pass it as DummyPageCount (rename the variable as well).
Here Cint(Math.Ceiling(cint(DummyPageCount)/10))
is
Converting the DummyPageCount string to Int then dividing by 10
The value is then rounded using Math.Ceiling. This provides the higher double value
Finally convert the double to int by using Cint
The delay before injecting javascript is to ensure that the page gets some time to render the results. You can optimize this as you wish.
Updated file :
ScrollToBottomOfWebPage.xaml (24.8 KB)
1 Like
system
(system)
Closed
August 7, 2022, 4:47am
20
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.