Using Google Sheets with IMPORTXML
to scrape a piece of information from a website via XPath
.
The specific piece of information I'm trying to extract is the Price/Sales (TTM) number, i.e., 2.97
Here's the XPath (I've tested it using the Google Chrome Extensions XPath Helper and XPather. It works.):
//div[@id='audit-integrity'][1]/table/tbody/tr[10]/td[2]
Here's my Google Finance function:
=IMPORTXML( "https://eresearch.fidelity.com/eresearch/evaluate/fundamentals/keyStatistics.jhtml?stockspage=keyStatistics&symbols=aapl" , "//div[@id='audit-integrity'][1]/table/tbody/tr[10]/td[2]")
The function doesn't work. Why?