Reputation: 171
I'm looking for a solution of my problem. I want to find all the href elements of my web page starting by
href="/lite/..... "
I want to check the http status of all my href starting by /lite/ My test is in Java and I'm using selenium
Any ideas ?
Thanks
Upvotes: 0
Views: 63
Reputation: 42528
You could use a CSS selector:
elements = driver.findElements(By.cssSelector("[href^='/lite/']"));
Note that it doesn't return the links for a frame element.
Upvotes: 1
Reputation: 11942
Can you use XPath? Then you could use something like:
//*[starts-with(@href,'/lite')]
Upvotes: 1