Search code examples
javaseleniumbotsinstagram

Can I use java to make scroll down action on instagram followers/following windows?


I see everyone is using Python for instagram automation. I want to use java. Is that possible? If so, I think I must switch frame or windows but I can't see anything in DOM structure that relates to windows/frames for instagram following/followers windows.

Any help is appreciated,

best


Solution

  • you have to do scrollBy on the scroller element

    Eg:

    enter image description here

    here the scroll element is a unique element with class isgrP

    JavascriptExecutor js = (JavascriptExecutor) driver;  
    scroll = driver.findElement(By.className("isgrP"))
    js.executeScript("arguments[0].scrolBy(0,arguments[0].scrollHeight)",scroll);