Selenium Web Page help scrolling down

#1

Hi;

I’ve searched a little for scrolling down the web page and I haven’t tried it, but I didn’t succeed

https://riigihanked.riik.ee/rhr-web/#/


0 Likes

#2

Hi,

That’s an infinite scroll and you can expand the result sets by applying this code in “Execute JavaScript” node:
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
getElementByXpath("/html/body/div[2]/rhr-search/rhr-main-content/main/ng-transclude/div/div/rhr-search-result/div/div/ol/li[20]/rhr-search-result-row/h3/a").focus()

Just remember that this code focuses to the 20th result which is the last element of the first set, so you have to modify the code in a loop or something to focus to the next last elements (e.g. 40, 60, …).

Best,
Armin

3 Likes

#3

Thanks; For support @armingrudd

1 Like

closed #4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

0 Likes