The following is a bunch of links ONLY one of them has a substring \"long\" as a value for the attribute href
With the help of xpath locator also, you can achieve the same.
Your statement would be:
driver.findElement(By.xpath(".//a[contains(@href,'long')]")).click();
And for clicking all the links contains long in the URL, you can use:-
List linksList = driver.findElements(By.xpath(".//a[contains(@href,'long')]"));
for (WebElement webElement : linksList){
webElement.click();
}