javascript - how to find the number of followers In Instagram through selenium web driver Java -
i trying following code running out error "unable locate element"
system.out.println(driver.findelement(by.xpath("//*[@id='react-root']/section/main/article/ul/li[2]/span/span")).gettext())
the following working out :-)
system.out.println(driver.findelement(by.xpath(".//*[@id='react-root']/section/main/article/header/div[2]/ul/li[2]/span/span")).getattribute("title"));
shorter xpath :
system.out.println(driver.findelement(by.xpath("//span[@id='react-root']//span[@title]")).getattribute("title"));
Comments
Post a Comment