Identify end of webpage

Sanoza

New Member
Hi,
How to check whether reached end of webpage.
I am taking screenshot of a webpage in blueprism by using prtsc and pgdn.
How to know whether i reached end of webpage, because the webpage length is varying for each search.

Could anyone please help on this.
Thank you.
 

VJR

Well-Known Member
Hi Sanoza,

Spy any topmost element of the webpage. This element should always be present on that webpage.
If this element is used in a Reader stage with an action called 'Get Screen Bounds' then it returns a collection with the columns as below-

View attachment 1542686732765.png

With every Activate & Scroll, the Top and Bottom property of the element changes (blue).
And you will notice that after it reaches the end of the page no matter how much you scroll these two properties remain the same (green).
View attachment 1542687581339.png

So what you need to do is have the Activate & Scroll followed by this Reader stage in a loop like structure.
The loop is a Decision stage where you check the previous Top and Bottom values (stored in a Data Item in the previous iteration of the loop) and compare it with the current Top and Bottom values. If they are the same then it means you have reached the end of page and your diagram should follow the 'Yes' branch of the Decision stage else it will continue to do the Activate & Scroll->Reader stage in a loop. Your action to capture the screenshot would be in the 'No' branch where the Decision stage checks [prev value] = [curr value]. Have default [prev value] may be as 0 so that it is used during the first iteration of the loop.
There could possibly be more such ways if you explore more on something like this.
 

sivagelli

Well-Known Member
hello,

If you want to take a screen print of entire page and using Chrome browser, you can use Ctrl + Shift + P. This will open Print pop-up; with selected Print to PDF. Click Print. This will Print entire web page as a pdf doc.

IE unfortunately do not have any build in feature, but there are add-ins.

I know, this is not a direct answer but thoughtful!
 

Sanoza

New Member
As i mentioned in the above post, my problem was solved when i was spying the topmost element and getting screenbounds.

Suddenly it is not working as expected. Means if the page can have 3 pagedown then it is taking screenshots and pagedown for only 2 times and the screen bound is remain same for the subsequent pagedowns

My steps are,

1. Set screen bound as 0 for top and bottom
2. Read the screen bound
3. f matches then end
4. If not matches then
5. Set top and bottom value as new values
6. print screen and paste.
7. Page down
8. Go back to step 2

Could you please suggest what may be the cause for this issue?
 

Sanoza

New Member
As i mentioned in the above post, my problem was solved when i was spying the topmost element and getting screenbounds.

Suddenly it is not working as expected. Means if the page can have 3 pagedown then it is taking screenshots and pagedown for only 2 times and the screen bound is remain same for the subsequent pagedowns

My steps are,

1. Set screen bound as 0 for top and bottom
2. Read the screen bound
3. f matches then end
4. If not matches then
5. Set top and bottom value as new values
6. print screen and paste.
7. Page down
8. Go back to step 2

Could you please suggest what may be the cause for this issue?
 

Sanoza

New Member
As i mentioned in the above post, my problem was solved when i was spying the topmost element and getting screenbounds.

Suddenly it is not working as expected. Means if the page can have 3 pagedown then it is taking screenshots and pagedown for only 2 times and the screen bound is remain same for the subsequent pagedowns

My steps are,

1. Set screen bound as 0 for top and bottom
2. Read the screen bound
3. f matches then end
4. If not matches then
5. Set top and bottom value as new values
6. print screen and paste.
7. Page down
8. Go back to step 2

Could you please suggest what may be the cause for this issue?
 
Top