Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 235679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:17:04+00:00 2026-05-11T20:17:04+00:00

I’m new to Python and am playing around with making a very basic web

  • 0

I’m new to Python and am playing around with making a very basic web crawler. For instance, I have made a simple function to load a page that shows the high scores for an online game. So I am able to get the source code of the html page, but I need to draw specific numbers from that page. For instance, the webpage looks like this:

http://hiscore.runescape.com/hiscorepersonal.ws?user1=bigdrizzle13

where ‘bigdrizzle13’ is the unique part of the link. The numbers on that page need to be drawn out and returned. Essentially, I want to build a program that all I would have to do is type in ‘bigdrizzle13’ and it could output those numbers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:17:04+00:00Added an answer on May 11, 2026 at 8:17 pm

    As another poster mentioned, BeautifulSoup is a wonderful tool for this job.

    Here’s the entire, ostentatiously-commented program. It could use a lot of error tolerance, but as long as you enter a valid username, it will pull all the scores from the corresponding web page.

    I tried to comment as well as I could. If you’re fresh to BeautifulSoup, I highly recommend working through my example with the BeautifulSoup documentation handy.

    The whole program…

    from urllib2 import urlopen
    from BeautifulSoup import BeautifulSoup
    import sys
    
    URL = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=" + sys.argv[1]
    
    # Grab page html, create BeatifulSoup object
    html = urlopen(URL).read()
    soup = BeautifulSoup(html)
    
    # Grab the <table id="mini_player"> element
    scores = soup.find('table', {'id':'mini_player'})
    
    # Get a list of all the <tr>s in the table, skip the header row
    rows = scores.findAll('tr')[1:]
    
    # Helper function to return concatenation of all character data in an element
    def parse_string(el):
       text = ''.join(el.findAll(text=True))
       return text.strip()
    
    for row in rows:
    
       # Get all the text from the <td>s
       data = map(parse_string, row.findAll('td'))
    
       # Skip the first td, which is an image
       data = data[1:]
    
       # Do something with the data...
       print data
    

    And here’s a test run.

    > test.py bigdrizzle13
    [u'Overall', u'87,417', u'1,784', u'78,772,017']
    [u'Attack', u'140,903', u'88', u'4,509,031']
    [u'Defence', u'123,057', u'85', u'3,449,751']
    [u'Strength', u'325,883', u'84', u'3,057,628']
    [u'Hitpoints', u'245,982', u'85', u'3,571,420']
    [u'Ranged', u'583,645', u'71', u'856,428']
    [u'Prayer', u'227,853', u'62', u'357,847']
    [u'Magic', u'368,201', u'75', u'1,264,042']
    [u'Cooking', u'34,754', u'99', u'13,192,745']
    [u'Woodcutting', u'50,080', u'93', u'7,751,265']
    [u'Fletching', u'53,269', u'99', u'13,051,939']
    [u'Fishing', u'5,195', u'99', u'14,512,569']
    [u'Firemaking', u'46,398', u'88', u'4,677,933']
    [u'Crafting', u'328,268', u'62', u'343,143']
    [u'Smithing', u'39,898', u'77', u'1,561,493']
    [u'Mining', u'31,584', u'85', u'3,331,051']
    [u'Herblore', u'247,149', u'52', u'135,215']
    [u'Agility', u'225,869', u'60', u'276,753']
    [u'Thieving', u'292,638', u'56', u'193,037']
    [u'Slayer', u'113,245', u'73', u'998,607']
    [u'Farming', u'204,608', u'51', u'115,507']
    [u'Runecraft', u'38,369', u'71', u'880,789']
    [u'Hunter', u'384,920', u'53', u'139,030']
    [u'Construction', u'232,379', u'52', u'125,708']
    [u'Summoning', u'87,236', u'64', u'419,086']
    

    Voila 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 160k
  • Answers 160k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The issue was resolved by setting the FO_CACHE_SUPPORTED flag in… May 12, 2026 at 11:34 am
  • Editorial Team
    Editorial Team added an answer The using statement may hurt performance in the sense that… May 12, 2026 at 11:34 am
  • Editorial Team
    Editorial Team added an answer CODE String[] input = new [] { "Paris", "New York",… May 12, 2026 at 11:34 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.