Thursday, December 22, 2022

[FIXED] How to select and view only a specific cell?

Issue

I want to extract from the next code, only the first value. Unfortunately, I was unable and I didn't found similar answer for my question. So, here is the example of script:

**$1.61**

With bold I mark the value which I am interested to be visible. Only this value in one cell. Unfortunately I didn't have need the rest of values from table.

Here I will add my function (function will be use ):

=importxml("https://www.coingecko.com/en/coins/polygon","//td/span")

Please let me know how how to select to view only 1st line/value.

Thanks to all for support.


Solution

This should select 1st //td/span

=importxml("https://www.coingecko.com/en/coins/polygon","(//td/span)[1]")

Reference

https://librarycarpentry.org/lc-webscraping/02-xpath/index.html



Answered By - Max Daroshchanka
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.