简体   繁体   中英

Google Sheets yahoo finance importXML text not td data

On SO I often see people inquiring about how to import data from the tables on yahoo finance. I'm trying to import the business description under the profile section from yahoo finance. It seems this would require the importxml function but I'm struggling. This is my function:

=IMPORTXML("http://finance.yahoo.com/quote/AAPL/profile", "//div[@data-reactid='139']")

I think my issue is related to "div" but not sure. Might anyone be able to provide guidance? Thanks!

Sample formula:

=IMPORTXML(A1,"//h2[@data-reactid='139']/../p")
  • In this case, the URL of http://finance.yahoo.com/quote/AAPL/profile is put in "A1".
  • I used //h2[@data-reactid='139']/../p as the xpath.

Result:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM