问题
In the old version of Google spreadsheets, this could be done with the following formula:
=value(importXml("http://www.amazon.com/<your url here>", "//b[@class='priceLarge']"))
However, in the new version of Google spreadsheets, this does not work
How is this to be done now?
回答1:
This worked for me:
=importxml(hyperlink(concatenate("AMAZON_URL_HERE")),"//*[@id='priceblock_ourprice']")
回答2:
You have to replace the , by a ; to make it work:
=importxml(hyperlink(concatenate("AMAZON_URL_HERE"));"//*[@id='priceblock_ourprice']")
You can also specify the element, like this:
=importXml("AMAZON_URL_HERE";"//span[@id='priceblock_ourprice']")
The Syntax is explained here:
http://www.w3schools.com/xpath/xpath_syntax.asp
来源:https://stackoverflow.com/questions/25679966/how-do-i-get-amazon-price-information-into-google-sheets