0

I'm trying to extract the whole following Warcraftlog table in a Google Sheets. I just need the "names" with "count" and the "percentage numbers".

=IMPORTXML("URL"; "XPATH")
=IMPORTXML("https://classic.warcraftlogs.com/reports/P4CQdFTp21wADfKX/#boss=-3&difficulty=0&type=auras&ability=31035"; "//table[contains(@id,'main-table-0')]")

But it doesn't work with //table[contains(@id,'main-table-0')] in the Xpath. With //table/tr/td it will extract nearly everything on the warcraftlog website, except the table I want to extract.

Is there another option to extract them with XPath?

Rubén
  • 34,714
  • 9
  • 70
  • 166
Tony
  • 3
  • 1

1 Answers1

0
  1. You are after an html table so switch to IMPORTHTML
  2. Data is pulled dynamically from another endpoint you can find in the network tab of the browser, so make your request to that
  3. The last two webpage visible table columns are $ delimited in the retrieved table so you will need to split the entries e.g. using helper column in column D of sheet (if formula in A1) containing SPLIT

=IMPORTHTML("https://classic.warcraftlogs.com/reports/auras/P4CQdFTp21wADfKX/0/0/6175385/buffs/31035/0/0/0/0/source/0/-3.0.0/0/Any/Any/0", "table",1)

enter image description here

QHarr
  • 83,427
  • 12
  • 54
  • 101
  • Hi, can you explain me how you generate the new url? With other Combatlogs for example https://classic.warcraftlogs.com/reports/94VJZrLHQj7YmwqT/#boss=-3&difficulty=0&type=auras&ability=31035 it doesn't work, because the numbers doesn't match anymore. – Tony Feb 15 '22 at 06:37
  • https://classic.warcraftlogs.com/reports/auras/94VJZrLHQj7YmwqT/0/0/9256615/buffs/31035/0/0/0/0/source/0/-3.0.0/0/Any/Any/0. The variable bit is the 9256615 which is the endTime. According to one of the js files endTime is `The end time of the fight. This is an offset relative to the start of the report, not an absolute time. * This offset is in milliseconds.` So, you most likely can calculate it. However, as the url construct is the same but just with this number changing and the id P4CQdFTp21wADfKX which is in original url, you can filter web traffic for url using filter on `buffs/31035/` – QHarr Feb 15 '22 at 21:34
  • The end time desc I found in https://assets.rpglogs.com/js/app.a7aa2a851a3295afd2c0.js – QHarr Feb 15 '22 at 21:35