Results 1 to 7 of 7

Thread: Grabbing Information From A Webpage

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Posts
    87

    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

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Grabbing Information From A Webpage

    There are some threads here that tackles such already, have a search. Here's one.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Lively Member
    Join Date
    Apr 2004
    Location
    Philadelphia, PA
    Posts
    120

    Re: Grabbing Information From A Webpage

    Hello, zeka
    Make sure you have Inet1 control on your form.

    VB Code:
    1. strURL = "http://www.runescape.com/aff/runescape/serverlist.cgi?plugin=0&hires.x=102&hires.y=32"
    2.  
    3. strHTML = Inet1.OpenURL(strURL, icString)
    4.  
    5. 'get the number of players
    6. strWorld1 = ParseHTML(strHTML)
    7.  
    8. 'display number of players on World1
    9. lblWorld1.caption = strWorld1


    FUnction to parse the data from HTML
    VB Code:
    1. 'World 1
    2. Private Function ParseHTML(ByVal strHTML As String) As String
    3. Dim strTemp As String
    4.  
    5.     'Grab all of the string to the right of "class=c>World 1</a></td><td align=right>" >
    6.  
    7.     strTemp = Mid(strHTML, InStr(strHTML, "World 1") + Len("World 1"))
    8.    
    9.     'Delete everything to the left of the <td> tag along with the tag
    10.     strTemp = Mid(strTemp, InStr(strTemp, "<td align=right>") + 16)
    11.    
    12.    'Get the field val
    13.  
    14.     strTemp = Left(strTemp, InStr(strTemp, "</td>") - 1)
    15.    
    16.     'return val
    17.     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.

  4. #4
    Lively Member
    Join Date
    Apr 2004
    Location
    Philadelphia, PA
    Posts
    120

    Re: Grabbing Information From A Webpage

    did that work for u?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Posts
    87

    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

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Posts
    87

    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

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Posts
    87

    Re: Grabbing Information From A Webpage

    dont worry fixed it
    "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
  •  



Click Here to Expand Forum to Full Width