|
-
Aug 3rd, 2005, 03:52 AM
#1
Thread Starter
Lively Member
Grabbing Information From A Webpage
Hello everybody! .
I am creating a project to aid playing an online game called runescape (not it is not anything against the rules), but I need help "grabbing" information from a webpage. One of the webpages on RS has all the world information, including how many people are on each world. I am wishing to get this information in VB and then display it in VB.
If anybody could give me any tips or point me in the right direction, it would be greatly appreciated.
Zeka
"Most cars on our roads have only one occupant, usually the driver."
- Carol Malia, BBC Anchorwoman
"I do not like this word "bomb." It is not a bomb. It is a device that is exploding."
- Jacques le Blanc, French ambassador on nuclear weapons
"Solutions are not the answer."
- Richard Nixon, former U.S. President
-
Aug 3rd, 2005, 04:16 AM
#2
Re: Grabbing Information From A Webpage
There are some threads here that tackles such already, have a search. Here's one.
-
Aug 3rd, 2005, 05:41 AM
#3
Lively Member
Re: Grabbing Information From A Webpage
Hello, zeka
Make sure you have Inet1 control on your form.
VB Code:
strURL = "http://www.runescape.com/aff/runescape/serverlist.cgi?plugin=0&hires.x=102&hires.y=32"
strHTML = Inet1.OpenURL(strURL, icString)
'get the number of players
strWorld1 = ParseHTML(strHTML)
'display number of players on World1
lblWorld1.caption = strWorld1
FUnction to parse the data from HTML
VB Code:
'World 1
Private Function ParseHTML(ByVal strHTML As String) As String
Dim strTemp As String
'Grab all of the string to the right of "class=c>World 1</a></td><td align=right>" >
strTemp = Mid(strHTML, InStr(strHTML, "World 1") + Len("World 1"))
'Delete everything to the left of the <td> tag along with the tag
strTemp = Mid(strTemp, InStr(strTemp, "<td align=right>") + 16)
'Get the field val
strTemp = Left(strTemp, InStr(strTemp, "</td>") - 1)
'return val
ParseHTML = strTemp
I also have code on how to grab player stats from the stat page if u need that too.
You can try and put this in an array to cycle through each world and the get the data.
PS- I'm starting a new client project for rs, email me if u wanna help out. ([email protected])
Last edited by Nervotrep; Aug 3rd, 2005 at 05:48 AM.
-
Aug 3rd, 2005, 05:18 PM
#4
Lively Member
Re: Grabbing Information From A Webpage
-
Aug 11th, 2005, 02:00 AM
#5
Thread Starter
Lively Member
Re: Grabbing Information From A Webpage
hey both of you, thanks! I have yet to try this but is sounds great. The code for grabbing the players stats would be greatly appreciated. Thanks again.
"Most cars on our roads have only one occupant, usually the driver."
- Carol Malia, BBC Anchorwoman
"I do not like this word "bomb." It is not a bomb. It is a device that is exploding."
- Jacques le Blanc, French ambassador on nuclear weapons
"Solutions are not the answer."
- Richard Nixon, former U.S. President
-
Aug 11th, 2005, 02:15 AM
#6
Thread Starter
Lively Member
Re: Grabbing Information From A Webpage
ummm i cant even add the inet control, it says appropriate liscence information could not be found ummm... help? thanks guys
"Most cars on our roads have only one occupant, usually the driver."
- Carol Malia, BBC Anchorwoman
"I do not like this word "bomb." It is not a bomb. It is a device that is exploding."
- Jacques le Blanc, French ambassador on nuclear weapons
"Solutions are not the answer."
- Richard Nixon, former U.S. President
-
Aug 11th, 2005, 02:34 AM
#7
Thread Starter
Lively Member
Re: Grabbing Information From A Webpage
"Most cars on our roads have only one occupant, usually the driver."
- Carol Malia, BBC Anchorwoman
"I do not like this word "bomb." It is not a bomb. It is a device that is exploding."
- Jacques le Blanc, French ambassador on nuclear weapons
"Solutions are not the answer."
- Richard Nixon, former U.S. President
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|