0

I am trying to use the importxml to get the percentage changes data from https://www.investing.com/crypto/bitcoin.

enter image description here

Unfortunately, when I retrieve it with the following formula, it retrieves other data as well.

=importxml("https://www.investing.com/crypto/bitcoin","//span[@dir='ltr']",)

enter image description here

0

You want to get the "percentage change" element from a website using IMPORTXML. You are using XPath of //span[@dir='ltr'] but getting a number of values, including the individual element required.

When extracting the XPath, you need to drill down further into the HTML to identify the specific line for the element that you require. Use the "Developer Tools" provided by your browser (Chrome, Firefox and Edge each have the same set of tools), select the specific line, right click, Copy, Copy XPath.

  • XPath for "percentage change": //*[@id="fullColumn"]/div[6]/div[1]/div[1]/div[2]/span[4]

xtml


Summary

summary

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.