0
votes

First post on Stack Overflow! I have minimal IT/Dev background, and I was just trying to learn how to data scrape using the Import XML function in Google Sheets to get a little experience with the function and I've ran into a speed bump, hoping you can help!

I've been successful in my attempts to pull the data I would like so far, but there is a tiny amount of information I would also like to extract, but can't really figure it out thus far. I can see the information in Google DevTools. (Screenshot attached)

The data is stored in the Class definition line and it defines the time Last Seen, accessible one of two ways.
URL : https://us.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=11807&SortBy=Price&Order=asc

Desired function from ImportXML would be to pull the text, or the URL Extension - With the information of one of those two pieces of information

Thanks for your help!

*EDIT Added Google Sheets Screenshot

Devtool Screenshot Google Sheets Screenshot

Red Circles for Values I Would Like To Import

1
I have to apologize for my poor English skill. I cannot understand about your goal from your question. Can I ask you about the result values you expect? - Tanaike
Ofcourse! I am trying to collect and consolidate sales data from the specific item. The link in the summary navigates directly to the search query. I can pull all the data from that search query, but I cannot import the "Last Seen" time from the website. If you check the 2nd screenshot I have added, this is the formula I am currently using to try and pull the "Last Seen" data with, however it populates an empty cell, with no error, or value. As you can see, the other columns can pull the live data just fine. - StratusFury
So the desired outcome would be -- =importxml("tamrieltradecentre.com/pc/Trade/…) -- This would pull all of the "Last Seen" numbers from the primary table, just as it is doing with the other categories. However it populate nothing, no error, or value. - StratusFury
Thank you for replying and adding more information. I could understand about your goal. For this, when I checked the HTML of the URL, it was found that the values of "Last seen" like "1 Hour ago" are put using Javascript. In this case, unfortunately, the values cannot be retrieved by IMPORTXML. I apologize for this. - Tanaike
hi @Tanaike, thank you for that answer in your comment. Could you please post it as an answer to it can reach more people. Generally, people don't read comments. - alberto vielma

1 Answers

1
votes
  • You want to retrieve the values of "Last seen" like "1 Hour ago" from the URL using IMPORTXML.

When I checked the site of the URL, it was found that at the URL you want to use, the values like "1 Hour ago" are put using Javascript. In this case, unfortunately, that cannot be retrieved using IMPORTXML. Because IMPORTXML cannot evaluate Javascript.