Log in

View Full Version : Help grabbing runescape hiscore information for excel speadsheet!



YoHoJo
09-19-2011, 06:43 PM
Hey I want to grab hiscore info (like levels for a particular skill) from the Runescape hiscore page and show them in a excel spreadsheet, how do?

bevardis
09-19-2011, 06:53 PM
I tried it and didn't workout with latest runescape hiscores. It did work for google docs tho. There are tutorials in the web for the latter.

Boreas
09-20-2011, 07:08 AM
for googledocs

=Index(ImportXml(Concat("http://services.runescape.com/m=hiscore/compare.ws?user1=",B7), "//<span>"),B6)

B7 is user name, B6 is a number between 40 and at least 100. Unless there is a different way to view hiscores, the trouble is that the html code isn't using a <table> or something else ImportHTML can look at (like the item price stuff does). I don't know how complex the parameter for ImportXml can be, but when it's //span it will return an array of the contents of <span>123</span>. B6 being the index of that array. Unfortunately, when a player is not ranked for a skill, the page uses less of those span tags, so you can't predict which index will refer to mage level.

YoHoJo
09-20-2011, 07:17 AM
So what is B6 exactly again? Why number between 40 and 100?
And I'm completely lost about //<span> part!

Boreas
09-21-2011, 01:19 AM
B6 and B7 are cells in the spreadsheet that contain a number and a username.

Go here http://services.runescape.com/m=hiscore/compare.ws?user1=zezmia and view page source. Ctrl+F for whatever the total level is, and you will see it is between <span> and </span>. If you put the right number in B6, you will get that level. If you put in a different number for B6, you will get something in between a different pair of <span> and </span>.

From what I understand, the ImportXML, when used with "//<span>" as the second parameter (and URL as the first), returns an array. Each element in the array is the contents of a span block. Index then returns one of them (whichever number is in B6).

nickrules
09-21-2011, 03:29 AM
Im on my mobile, so this wont be the best, but have you considered using getPage(page:string):string; (docs.villavu.com/simba/scriptref/web.html#getpage)? Then using string manipulation (docs.villavu.com/simba/scriptref/string.html), get the data you want.


Also, somebody made a freerice script a looong time ago. Point is, it used this same method. Look it up, and see if you can gain anything of use from that

Boreas
09-21-2011, 04:09 AM
Do you need them to be created _in_ the spreadsheet, or writeln them in Simba and then paste into spreadsheet?