'The right XPATH for IMPORTXML (for Yahoo Finance)

I am trying to extract the Stock Price History Section from Yahoo Finance Statistics page. The following Xpath seems to point to the right section, but the function doesn't work in GoogleSheets. Can someone let me know how to correct this?

=IMPORTXML(
"https://finance.yahoo.com/quote/PLUG/key-statistics?p=PLUG",
"//*[@id="Col1-0-KeyStatistics-Proxy"]/section/div[3]")

Thanks a lot.



Solution 1:[1]

The div that you are looking for is one level deeper.

To get that one you have to use:

//*[@id="Col1-0-KeyStatistics-Proxy"]/section/div[2]/div[3]

if the order would change you could also use:

//div[h2[span[.='Financial Highlights']]]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Siebe Jongebloed