I'm attempting to automate the Instagram website, but when I click on the followers link it opens a dialog box with users to follow. However, when I try to scroll within that dialog box, it ends up scrolling the main page rather than the followers dialog box itself. Any suggestions on how to make this work?
Below is the code snippet I used:
WebElement element = driver.findElement(By.cssSelector("div.pbNvD.fPMEg.HYpXt"));
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.scrollBy(0,1000)",element);