I have the following XPath:
//div[contains(@id, \'box\')]/div/h4/small/a[contains(@href, \'google\')]/@href
When I try out this XPath in XP
You should write xpath first eg
WebDriver_Object_name.findElement(By.xpath("...xpath...")).getAttribute("..Attri_name..");
Here your WebDriver_Object_name might be selenium
WebDriver_Object_name