0
votes

I am trying to get the value of an element attribute from this site via importXML in Google Spreadsheet using XPath.

The attribute value i seek is content found in the span class="item-chart_server-price__1r2rn". outputs is 2,427 Z

Tried using:

  • //*[@id='app']/div[2]/div[2]/span[2] i get #N/A;
  • //div[@id='app']//div[@class='item-chart_item-chart__3YMlA']//div[@class='item-chart_server__37cgg']/span[@class='item-chart_server-price__1r2rn'] i get #N/A;
  • //span[@class='item-chart_server-price__1r2rn'] i get #N/A;
2

2 Answers

0
votes

looks like this won't be possible. all you can get is:

=IMPORTXML("https://www.romexchange.com/?q=steel","//*")

enter image description here

0
votes

Indeed, I was not able to fetch the data using ImportXML, but I ended up being able to fetch from romexchange.com using a custom javascript function.

You can have a look at it in https://github.com/diogovk/rom_exchange_sheets_macro/blob/master/rom_exchange_sheets_macro.js

To enable it on your sheets, go to Tools->Script editor. After you saved a new function ROMX_latest will be available.