0

So basically I'm trying to import a list of values from a certain web-page into my spreadsheet and I'm stuck. I want to make a list of names with their corresponding number stages next to them, all separated in columns. It should look like this:

Item name        Stage 1 Stage 2 Stage 3 . . .

War Spirit        1-1

Hollow Flower     1-2

Homely Slippers   1-3   8-3   9-2   12-4

For the names list I used the formula I used for the names was =IMPORTFROMWEB("ln.nikkis.info/drops", "//ul[@class='collapsible']/li[1]/div[2]/div/a/span")

I was able to get the names list using the ImportfromWeb function (Note: ImportXML doesn't have the capacity to extract such large contents of data, this one included exceeds the limit so I had to use Importfromweb, an Add On that you install in your spreadsheets. Importweb has the same behaiviour as Importxml but it doesn't return the Exceed maximum size error), but while trying to do the same for the stages I've encountered a problem: each name can have from 1 to 5 assigned stages, all of them being direct sibling elements, so when I import them the stages are placed one under the other one, when in reality I need those sibling elements to be placed on the same row in different columns. This is the formula I've got so far:

=IMPORTXML("https://ln.nikkis.info/drops/",//ul[@class='collapsible']/li[1]/div[2]/div/a/p/span[@class='di'] )

The ancestor nodes from the link should be:

<body>/<main>/<dic class="container">/<ul class="collapsible"/<li class> (the first of them only, the one that says 'maiden drops'). then I need to import all the <span class ="di" within that first <li class> (a href/p/span class="di")

How can I modify the xPath to make this work? Or should I combine the importxml with other formulas?

8
  • Welcome to Web Applications. What do you mean by "importfromweb"? Is this a custom function? What is the inner xml/html code or the parent node? – Rubén Aug 26 '20 at 0:48
  • @Rubén Importfromweb is a function from an AddOn on spreadsheets. It works exactly like ImportXML except it can exceed the 50 data limit, I'm using it since the chunk of data I need to import is too large for ImportXML. The ancestor nodes from link should be: <body>/<main>/<dic class="container">/<ul class="collapsible"/<li class> (the first of them only, the one that says 'maiden drops') then I need to import all the <span class ="di" within that first <li class> (a href/p/span class="di"). Sorry I'm new to this so I'm not particularly good at quoting an xpath, I'll specify more if needed – Blind City Aug 26 '20 at 14:09
  • What do you mean by "50 data limit"? Regarding the datails about the ancestor nodes, please edit the question to add to it all the relevant details. – Rubén Aug 26 '20 at 17:12
  • @Rubén I've just added the extra info in the question – Blind City Aug 26 '20 at 17:55
  • IMPORTXML can't be used for the URL in the question as it returns Error Resource at url contents exceeded maximum size for even an xPath as simple as //title What formula do you used to get the list names? – Rubén Aug 26 '20 at 18:09

Your Answer

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

Browse other questions tagged or ask your own question.