0

Is there any easy / automated way to scroll down in a page using RSelenium?

I use a delay in a page in which I should scroll down to see the content.

remDr$navigate("http://www.pageyouprefer.com/")
Sys.sleep(35)
Berbery
  • 297
  • 2
  • 4
  • 12
  • Duplicate of http://stackoverflow.com/questions/31901072/scrolling-page-in-rselenium and http://stackoverflow.com/questions/34251014/page-scrolling-using-rselenium – lukeA Jan 03 '16 at 14:00
  • @lukeA thank you. There is no answer in this post so I asked it. – Berbery Jan 03 '16 at 14:11
  • I thought it was obvious, but maybe it was not - my fault. I edited the [previous answer](http://stackoverflow.com/questions/31901072/scrolling-page-in-rselenium). – lukeA Jan 03 '16 at 14:22
  • Perhaps you tell us how much you want to scroll down apart from minimum movement, page, top or end (since this has already been answered - see the first link of lukeA). – R Yoda Jan 03 '16 at 14:27
  • @R Yoda the page I try to scroll down is a page in which when I scroll down new content appears and it needs more scroll down to see additional new content until to finish. I tried to find something in the source code but I didn't. – Berbery Jan 03 '16 at 14:32
  • @Berbery then scroll down in loop until you reach the bottom of page. – Mirek Długosz Jan 03 '16 at 15:47

1 Answers1

1

You can scroll by javascript execute.

Try this one.

WebDriver driver = new FirefoxDriver();
JavascriptExecutor js = (JavascriptExecutor)driver;
jse.executeScript("window.scrollBy(0,200)", "");
Leon Barkan
  • 2,676
  • 2
  • 19
  • 43