0
votes

I have been using importxml to dynamically get data from a websource. I achieved this using multiple importxml formulas. The total no of rows is less than 200. But now I am getting the error "Resource at URL contents exceeded maximum size.". This URL contents are not larger than 200 rows.

Anybody have any tips. I may have to use google app script to replicate this. Does anyone have any helpful suggestions to achieve this? I am an amateur when it comes to google script.

Sample Spreadsheet located here.

https://docs.google.com/spreadsheets/d/1bQqCpT-dn5ll09Rh07xC4Z3by1I3jkuk3qc3sA1iSBk/edit?usp=sharing

Basically. I am after all race details for today from the links in Col D of backend sheet.

For each event, I want to extract the following xpaths

Box, Name, Form, Speed, Rating, Rated Odds - //tr[@class="our-price"]. All separate columns
Overall Win, Place % - //div[@class="runnerRight"]/table[2]/tbody/tr[1]/td[3]
TRACK/DIST WIN, PLACE% -//div[@class="runnerRight"]/table[2]/tbody/tr[3]/td[3]
BEST 1st Sec/Dist - //div[@class="runnerRight"]/table[2]/tbody/tr[4]/td[2]
BEST Time Trk/Dist - //div[@class="runnerRight"]/table[2]/tbody/tr[5]/td[2]
Box Wins - //table[@class="longFormStatsBox"]/tbody/tr[2]
Box Races - //table[@class="longFormStatsBox"]/tbody/tr[3]
1
While including a link to a spreadsheet could be helpful, the question body should all the required details. In this case you should include the formula, the url and also a brief descrition of your analysis of the source code of the websource.Rubén
The Spreadsheet is no longer accesible. Can you please add more information?Jose Vasquez
Sorry it should be accessible now. All the xpaths I used are in cell references so should be easy to follow. But I will add more detailsJoe Abraham

1 Answers

0
votes

The problem occurs because the source code of the page is too big to be parsed by IMPORTXML, it has >47k code lines.

You have to look for another page having less code lines. Instead of the resulting url in N1

https://thegreyhoundrecorder.com.au//form-guides/angle-park/long-form/72146/all

try (replace /all by /1 as it has < 6k code lines)

https://thegreyhoundrecorder.com.au//form-guides/angle-park/long-form/72146/1

then insted of /1, use /2 etc. until you get all the results you are looking for.

Related