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())

enter image description here

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

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -