Can anyone tell me how to print all the friend list in facebook using selenium webdiver? I am finding it difficult to load all the friends names:
driver.findElement(By.xpath(".//*[@id='email']")).sendKeys("*****");
driver.findElement(By.xpath(".//*[@id='pass']")).sendKeys("*********");
driver.findElement(By.xpath(".//*[@value='Log In']")).sendKeys(Keys.ENTER);
WebElement elememt1 = driver.findElement(By.xpath(".//*[@title='Profile']"));
WebDriverWait wait1 = new WebDriverWait(driver, 20);
wait1.until(ExpectedConditions.visibilityOf(elememt1));
elememt1.click();
WebDriverWait wait2 = new WebDriverWait(driver, 20);
wait2.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath(".//*[@data-tab-key='friends']"))));
driver.findElement(By.xpath(".//*[@data-tab-key='friends']")).click();
((JavascriptExecutor) driver)
.executeScript("window.scrollTo(0, 1000)");
This code will print all your friend's name on FB: