Scraping example

Rough code from Ethan Mandelup and Jeffrey Soffer.


In [1]:
from bs4 import BeautifulSoup
import urllib
import pandas as pd
from urllib.request import Request, urlopen

df = pd.read_csv('Steam_DB_Info_Appsv2.csv',encoding='iso-8859-1',error_bad_lines=False)
#df.columns.append('Score')
dfname = df['NAME']
for n in range(len(dfname)):
    game_name = dfname[n]  ##just for example
    game_name=game_name.replace(' ','%20')  ### you should probaly do some trial and error and see how much you need to manipulate 
                                            ### your game name so that the code is robust. I just included one exmaple - add %20 instead of space.###

    url_to_scrape = 'http://www.metacritic.com/search/all/'+game_name+'/results'
    try:
        req = Request(url_to_scrape, headers={'User-Agent': 'Mozilla/5.0'})
        webpage = urlopen(req).read()
    except Exception as e:
        print ('something went wrong')
        print (e)
    print (url_to_scrape)
    html = BeautifulSoup(webpage, 'html.parser')
    all_spans = html.find_all('span')
    for span in all_spans:
        if span.get('class') is not None and 'metascore_w' in span.get('class'):
            #print (span)
            score = int(span.text)
            print (score)
            df.loc[(df.NAME== dfname[n]) ,'SCORE'] = score
            break
    
#f = urllib.request.urlopen(url_to_scrape)


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-cbac8b3595f0> in <module>()
      4 from urllib.request import Request, urlopen
      5 
----> 6 df = pd.read_csv('Steam_DB_Info_Appsv2.csv',encoding='iso-8859-1',error_bad_lines=False)
      7 #df.columns.append('Score')
      8 dfname = df['NAME']

C:\Users\dbackus\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision)
    527                     skip_blank_lines=skip_blank_lines)
    528 
--> 529         return _read(filepath_or_buffer, kwds)
    530 
    531     parser_f.__name__ = name

C:\Users\dbackus\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
    293 
    294     # Create the parser.
--> 295     parser = TextFileReader(filepath_or_buffer, **kwds)
    296 
    297     if (nrows is not None) and (chunksize is not None):

C:\Users\dbackus\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, f, engine, **kwds)
    610             self.options['has_index_names'] = kwds['has_index_names']
    611 
--> 612         self._make_engine(self.engine)
    613 
    614     def _get_options_with_defaults(self, engine):

C:\Users\dbackus\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine)
    745     def _make_engine(self, engine='c'):
    746         if engine == 'c':
--> 747             self._engine = CParserWrapper(self.f, **self.options)
    748         else:
    749             if engine == 'python':

C:\Users\dbackus\AppData\Local\Continuum\Anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, src, **kwds)
   1117         kwds['allow_leading_cols'] = self.index_col is not False
   1118 
-> 1119         self._reader = _parser.TextReader(src, **kwds)
   1120 
   1121         # XXX

pandas\parser.pyx in pandas.parser.TextReader.__cinit__ (pandas\parser.c:3246)()

pandas\parser.pyx in pandas.parser.TextReader._setup_parser_source (pandas\parser.c:6111)()

OSError: File b'Steam_DB_Info_Appsv2.csv' does not exist

In [87]:
#this gets data from steamspy on # of owners
dfname = df['NAME']
for n in range(len(dfname)):
    game_name = dfname[n]  ##just for example
    game_name=game_name.replace(' ','+')  ### you should probaly do some trial and error and see how much you need to manipulate 
                                            ### your game name so that the code is robust. I just included one exmaple - add %20 instead of space.###
    url_to_scrape = 'http://steamspy.com/search.php?s='+game_name+''
    try:
        req = Request(url_to_scrape, headers={'User-Agent': 'Mozilla/5.0'})
        webpage = urlopen(req).read()
    except Exception as e:
        print ('something went wrong')
        print (e)
    print (url_to_scrape)
    html = BeautifulSoup(webpage, 'html.parser')
    all_strong = html.find_all('strong')
    for strongowners in all_strong:
        if strongowners.text == 'Owners':
            print(strongowners.next.next)
            ownersnum = strongowners.next.next
            ownersnum = ownersnum.replace(': ','')
            ownersnum = ownersnum.replace(',','')
            ownersnum, sep, tail = ownersnum.partition(' ±')
            ownersnum = int(ownersnum)
            break
    df.loc[(df.NAME== dfname[n]) ,'# of Owners'] = ownersnum


http://steamspy.com/search.php?s=H1Z1:+Just+Survive+Test+Server
: 411,740 ± 15,432
http://steamspy.com/search.php?s=Yelaxot
: 5,312 ± 1,753
http://steamspy.com/search.php?s=Coffee+Pot+Terrarium
http://steamspy.com/search.php?s=Kismet
: 863 ± 1,194
http://steamspy.com/search.php?s=Why+Am+I+Dead+At+Sea
: 2,125 ± 1,109
http://steamspy.com/search.php?s=H1Z1:+King+of+the+Kill+Test+Server
: 2,544,960 ± 38,231
http://steamspy.com/search.php?s=Steel+Rain
: 9,561 ± 2,353
http://steamspy.com/search.php?s=AltspaceVR
: 14,721 ± 2,919
http://steamspy.com/search.php?s=Software+Inc.
: 40,825 ± 4,862
http://steamspy.com/search.php?s=Logic+Missile
: 911 ± 726
http://steamspy.com/search.php?s=Mr.+Nibbles+Forever
: 880 ± 859
http://steamspy.com/search.php?s=Lavapools
: 490 ± 959
http://steamspy.com/search.php?s=Hover+Cubes:+Arena
: 306,719 ± 13,321
http://steamspy.com/search.php?s=Share
: 108,816 ± 7,937
http://steamspy.com/search.php?s=Zombillie
http://steamspy.com/search.php?s=Skyreach
http://steamspy.com/search.php?s=XCavalypse
http://steamspy.com/search.php?s=I+and+Me
: 947,777 ± 23,392
http://steamspy.com/search.php?s=The+Pit+And+The+Pendulum
: 459 ± 634
http://steamspy.com/search.php?s=Games+of+Glory
: 140,080 ± 9,005
http://steamspy.com/search.php?s=Kerbal+Space+Program
: 64,349 ± 6,104
http://steamspy.com/search.php?s=Labyrinth
: 4,705 ± 1,650
http://steamspy.com/search.php?s=Block'hood
: 97,130 ± 7,499
http://steamspy.com/search.php?s=Chucks+Challenge+3D
: 21,399 ± 3,520
http://steamspy.com/search.php?s=ARK:+Survival+Of+The+Fittest
: 1,474,253 ± 29,149
http://steamspy.com/search.php?s=So+Long+Earth
: 490 ± 959
http://steamspy.com/search.php?s=Zavix+Tower
: 26,863 ± 3,944
http://steamspy.com/search.php?s=Piercing+Blow
: 322,806 ± 13,666
http://steamspy.com/search.php?s=Viking+Squad
: 485,043 ± 16,747 
http://steamspy.com/search.php?s=Euclidean
: 5,615 ± 1,803
http://steamspy.com/search.php?s=Falling+Stars:+War+of+Empires
: 64,349 ± 6,104
http://steamspy.com/search.php?s=Pitfall+Planet
: 441,790 ± 15,984
http://steamspy.com/search.php?s=Heroes+of+the+West
: 2,854,107 ± 40,465 
http://steamspy.com/search.php?s=Spunk+and+Moxie
: 432 ± 844
http://steamspy.com/search.php?s=Shiness:+The+Lightning+Kingdom
: 911 ± 726
something went wrong
'ascii' codec can't encode character '\xa0' in position 32: ordinal not in range(128)
http://steamspy.com/search.php?s=Wevr+Transport (Wevr+Transport)
: 911 ± 726
http://steamspy.com/search.php?s=Systematic+Immunity
http://steamspy.com/search.php?s=Tyto+Ecology
: 6,829 ± 1,988
http://steamspy.com/search.php?s=Heliborne
: 12,445 ± 2,684
http://steamspy.com/search.php?s=Nelly+Cootalot:+The+Fowl+Fleet
: 918 ± 897
http://steamspy.com/search.php?s=Sweet+Escape+VR
: 490 ± 959
http://steamspy.com/search.php?s=A+Quiver+of+Crows
http://steamspy.com/search.php?s=TransOcean+2:+Rivals
: 2,276 ± 1,148
http://steamspy.com/search.php?s=Return+2+Games:+Book+of+Demons
: 334,795 ± 13,917
http://steamspy.com/search.php?s=Divinity:+Original+Sin+Enhanced+Edition
: 828,338 ± 21,873
http://steamspy.com/search.php?s=Darkest+Dungeon
: 804,207 ± 21,553
http://steamspy.com/search.php?s=Man+O'+War:+Corsair
: 1,973 ± 1,068
http://steamspy.com/search.php?s=Worlds
: 828,338 ± 21,873
http://steamspy.com/search.php?s=Demon's+Crystals
: 34,299 ± 4,456
http://steamspy.com/search.php?s=Candle
: 4,553 ± 1,623
http://steamspy.com/search.php?s=Amaranthine
: 1,973 ± 1,068
http://steamspy.com/search.php?s=Vagante
: 26,407 ± 3,910
http://steamspy.com/search.php?s=VEGA+Conflict
: 203,518 ± 10,853
http://steamspy.com/search.php?s=Massive
: 39,914 ± 4,807
http://steamspy.com/search.php?s=The+Forest
: 1,878,708 ± 32,884
http://steamspy.com/search.php?s=RefRain+-prism+memories-
: 786,905 ± 21,320
http://steamspy.com/search.php?s=Dashy+Square
: 1,366 ± 889
http://steamspy.com/search.php?s=Europa+Universalis+IV+Beta
: 70,723 ± 6,399
http://steamspy.com/search.php?s=QUASAR
http://steamspy.com/search.php?s=Kathy+Rain
: 440 ± 608
http://steamspy.com/search.php?s=FIVE:+Guardians+of+David
: 1,669 ± 983
http://steamspy.com/search.php?s=History+in+Letters+-+The+Eternal+Alchemist
: 69,053 ± 6,323
http://steamspy.com/search.php?s=Zero+Gravity
: 490 ± 959
http://steamspy.com/search.php?s=Master+of+Orion
: 63,742 ± 6,075
http://steamspy.com/search.php?s=Ashes+of+the+Singularity
: 56,153 ± 5,702
http://steamspy.com/search.php?s=Rogue+Wizards
: 74,062 ± 6,548
http://steamspy.com/search.php?s=ASMR+Universe
: 4,553 ± 1,623
http://steamspy.com/search.php?s=Boogeyman
: 4,249 ± 1,568
http://steamspy.com/search.php?s=The+Huntsman:+Winter's+Curse
: 896,632 ± 22,754 
http://steamspy.com/search.php?s=Envelop
http://steamspy.com/search.php?s=Zeuxis+:+procedural+texture+generator
: 702 ± 792
http://steamspy.com/search.php?s=Hide+&+Hold+Out+-+H2o
: 41,280 ± 4,889
http://steamspy.com/search.php?s=Fragmented
: 490 ± 959
http://steamspy.com/search.php?s=Masquerade:+The+Baubles+of+Doom
: 459 ± 634
http://steamspy.com/search.php?s=Shroud+of+the+Avatar:+Forsaken+Virtues
: 28,835 ± 4,086
http://steamspy.com/search.php?s=Major\Minor
: 37,790 ± 4,678
http://steamspy.com/search.php?s=Vertigo
: 4,857 ± 1,677
http://steamspy.com/search.php?s=The+Brookhaven+Experiment
: 2,884 ± 1,292
http://steamspy.com/search.php?s=Poly+Bridge
: 147,213 ± 9,231
http://steamspy.com/search.php?s=Stonehearth
: 116,253 ± 8,203
http://steamspy.com/search.php?s=MapleStory
: 539,679 ± 17,663
http://steamspy.com/search.php?s=TASTEE:+Lethal+Tactics
: 681,580 ± 19,846
something went wrong
'ascii' codec can't encode character '\xa0' in position 28: ordinal not in range(128)
http://steamspy.com/search.php?s=Necropolis (NECROPOLIS:+A+Diabolical+Dungeon+Delve)
: 681,580 ± 19,846
http://steamspy.com/search.php?s=Superku
http://steamspy.com/search.php?s=Torment:+Tides+of+Numenera
: 12,900 ± 2,733
http://steamspy.com/search.php?s=Homeworld+Remastered+Collection
: 530,725 ± 17,517
http://steamspy.com/search.php?s=Mech+Anarchy
: 1,518 ± 937
http://steamspy.com/search.php?s=Walk+The+Light
: 20,488 ± 3,444
http://steamspy.com/search.php?s=R.B.I.+Baseball+16
: 1,366 ± 889
http://steamspy.com/search.php?s=Firefall
: 2,837,261 ± 40,347
http://steamspy.com/search.php?s=STAR+WARS+Jedi+Knight:+Jedi+Academy
: 1,428,419 ± 28,695
http://steamspy.com/search.php?s=Dungeon+Defenders+II
: 1,931,675 ± 33,341
http://steamspy.com/search.php?s=PULSAR:+Lost+Colony
: 48,717 ± 5,311
http://steamspy.com/search.php?s=Leadwerks+Game+Engine
: 13,507 ± 2,796
http://steamspy.com/search.php?s=Tilt+Brush
: 35,210 ± 4,515
http://steamspy.com/search.php?s=Aurion:+Legacy+of+the+Kori-Odan
: 74,972 ± 6,588
http://steamspy.com/search.php?s=Initia:+Elemental+Arena
: 306,719 ± 13,321
http://steamspy.com/search.php?s=Cyberpong+VR
: 918 ± 897
something went wrong
'ascii' codec can't encode character '\xa0' in position 31: ordinal not in range(128)
http://steamspy.com/search.php?s=Rocket+League (Rocket+League)
: 918 ± 897
http://steamspy.com/search.php?s=Ticket+to+Ride
: 281,829 ± 12,770
http://steamspy.com/search.php?s=Natural+Selection+2
: 1,649,087 ± 30,820 
http://steamspy.com/search.php?s=WARSHIFT
: 8,499 ± 2,218
http://steamspy.com/search.php?s=SolForge
: 243,281 ± 11,865
http://steamspy.com/search.php?s=Ultimate+Fight+Manager+2016
: 391,252 ± 15,043
http://steamspy.com/search.php?s=RWBY:+Grimm+Eclipse
: 133,402 ± 8,788
http://steamspy.com/search.php?s=Death+by+Game+Show
: 432 ± 844
http://steamspy.com/search.php?s=The+Banner+Saga+2
: 33,237 ± 4,387
http://steamspy.com/search.php?s=BigScreen+Beta
: 173,316 ± 10,016
http://steamspy.com/search.php?s=The+SKIES
: 10,017 ± 2,408
http://steamspy.com/search.php?s=STAR+WARS+Rebellion
: 89,238 ± 7,188
something went wrong
'ascii' codec can't encode character '\xa0' in position 41: ordinal not in range(128)
http://steamspy.com/search.php?s=Rise+of+the+Tomb+Raider (Rise+of+the+Tomb+Raider)
: 89,238 ± 7,188
http://steamspy.com/search.php?s=Tom+Clancy's+Rainbow+Six+Siege
: 54,029 ± 5,593
http://steamspy.com/search.php?s=The+Isle
: 28,987 ± 4,097
http://steamspy.com/search.php?s=3030+Deathwar+Redux
: 395,350 ± 15,122
http://steamspy.com/search.php?s=Super+Time+Force+Ultra
: 65,715 ± 6,168
http://steamspy.com/search.php?s=Fahrenheit:+Indigo+Prophecy+Remastered
: 126,573 ± 8,560
http://steamspy.com/search.php?s=The+Culling
: 449,378 ± 16,120
http://steamspy.com/search.php?s=Two+Worlds+II
: 822,570 ± 21,797
http://steamspy.com/search.php?s=Choice+Chamber
: 4,553 ± 1,623
http://steamspy.com/search.php?s=Age+of+Mythology:+Extended+Edition
: 794,949 ± 21,429
http://steamspy.com/search.php?s=Holopoint
: 4,249 ± 1,568
http://steamspy.com/search.php?s=Lifeless
: 96,371 ± 7,469
http://steamspy.com/search.php?s=Savage+Lands
: 224,462 ± 11,397
http://steamspy.com/search.php?s=Castle+Story
: 189,100 ± 10,462
http://steamspy.com/search.php?s=VirZOOM
http://steamspy.com/search.php?s=Deus+Ex:+Mankind+Divided
: 1,134,297 ± 25,583
http://steamspy.com/search.php?s=Subnautica
: 611,920 ± 18,806
http://steamspy.com/search.php?s=ARK:+Survival+Evolved
: 3,059,749 ± 41,883 
http://steamspy.com/search.php?s=FEZ
: 1,361,794 ± 28,021
http://steamspy.com/search.php?s=Brigador
: 2,276 ± 1,148
http://steamspy.com/search.php?s=Substance+Painter+2
: 3,187 ± 1,358
http://steamspy.com/search.php?s=Tempest
: 18,364 ± 3,261
http://steamspy.com/search.php?s=Experience
: 2,530,087 ± 38,120
http://steamspy.com/search.php?s=TableTop+Soccer
: 1,821 ± 1,027
http://steamspy.com/search.php?s=Prison+Architect
: 1,582,310 ± 30,193
http://steamspy.com/search.php?s=Sir!+I'd+Like+To+Report+A+Bug!
: 4,098 ± 1,540
http://steamspy.com/search.php?s=Unveil
: 607 ± 592
http://steamspy.com/search.php?s=Avalon+Lords:+Dawn+Rises
: 1,516,140 ± 29,558 
http://steamspy.com/search.php?s=RPG+Tycoon
: 18,364 ± 3,261
http://steamspy.com/search.php?s=Parkitect
http://steamspy.com/search.php?s=Blood+and+Bacon
: 31,871 ± 4,296
something went wrong
'ascii' codec can't encode character '\xa0' in position 24: ordinal not in range(128)
http://steamspy.com/search.php?s=XCOM+2 (XCOM®+2)
: 31,871 ± 4,296
http://steamspy.com/search.php?s=Minecraft:+Story+Mode+-+A+Telltale+Games+Series
: 176,048 ± 10,094
http://steamspy.com/search.php?s=Catlateral+Damage
: 19,578 ± 3,367
http://steamspy.com/search.php?s=The+Count+Lucanor
: 1,973 ± 1,068
http://steamspy.com/search.php?s=The+Song+of+Seven+:+Chapter+One
: 210,954 ± 11,049
http://steamspy.com/search.php?s=Offworld+Trading+Company
: 84,078 ± 6,977
http://steamspy.com/search.php?s=Robocraft
: 9,727,882 ± 73,846
http://steamspy.com/search.php?s=Torgar's+Quest
: 1,572,445 ± 30,099
http://steamspy.com/search.php?s=Bell+Ringer
: 118,984 ± 8,299
http://steamspy.com/search.php?s=Sword+Coast+Legends
: 109,423 ± 7,959 
http://steamspy.com/search.php?s=Out+of+the+Park+Baseball+17
: 8,802 ± 2,257
http://steamspy.com/search.php?s=DCS+World
: 1,142,493 ± 25,675
http://steamspy.com/search.php?s=Epic+Clicker+Journey
: 53,422 ± 5,561
http://steamspy.com/search.php?s=Football+Tactics
: 8,651 ± 2,238
http://steamspy.com/search.php?s=Blacksea+Odyssey
: 1,669 ± 983
http://steamspy.com/search.php?s=Marvel+Heroes+2016
: 2,854,107 ± 40,465 
http://steamspy.com/search.php?s=KeeperRL
: 10,624 ± 2,480
http://steamspy.com/search.php?s=Link
: 630,587 ± 19,090
http://steamspy.com/search.php?s=Insane+Decay+of+Mind
: 432 ± 844
http://steamspy.com/search.php?s=CHKN
: 2,884 ± 1,292
http://steamspy.com/search.php?s=Dota+2
: 70,044,905 ± 176,610
http://steamspy.com/search.php?s=Grim+Dawn
: 421,454 ± 15,612
http://steamspy.com/search.php?s=HoloBall
: 2,295 ± 1,419
http://steamspy.com/search.php?s=Space+Food+Truck
: 3,035 ± 1,325
http://steamspy.com/search.php?s=Rust
: 28,684 ± 4,075
http://steamspy.com/search.php?s=Bounty+Train
: 7,892 ± 2,137
http://steamspy.com/search.php?s=The+Detail
: 56,002 ± 5,694
http://steamspy.com/search.php?s=Nevermind
: 7,892 ± 2,137
http://steamspy.com/search.php?s=Babel:+Tower+to+the+Gods
: 1,377 ± 1,099
http://steamspy.com/search.php?s=iOMoon
http://steamspy.com/search.php?s=Factorio
: 373,040 ± 14,689
http://steamspy.com/search.php?s=Ghost+in+the+Shell+Stand+Alone+Complex+First+Assault+Online
: 151,310 ± 9,359
something went wrong
'ascii' codec can't encode character '\xe3' in position 36: ordinal not in range(128)
http://steamspy.com/search.php?s=Pesadelo+-+Regressão
: 151,310 ± 9,359
http://steamspy.com/search.php?s=Second+Warfare
: 896 ± 1,240
http://steamspy.com/search.php?s=The+Fifth+Expedition
: 1,366 ± 889
http://steamspy.com/search.php?s=Big+Pharma
: 73,151 ± 6,508
http://steamspy.com/search.php?s=Three+Days
: 490 ± 959
http://steamspy.com/search.php?s=Holodrive
: 83,168 ± 6,939
http://steamspy.com/search.php?s=Ballistic+Overkill
: 10,775 ± 2,498
http://steamspy.com/search.php?s=Counter+Spell
: 3,339 ± 1,390
http://steamspy.com/search.php?s=Barbie+Dreamhouse+Party
: 4,553 ± 1,623
http://steamspy.com/search.php?s=The+Mims+Beginning
: 4,553 ± 1,623
http://steamspy.com/search.php?s=Armello
: 96,827 ± 7,487
http://steamspy.com/search.php?s=DOOM
: 391,252 ± 15,043
http://steamspy.com/search.php?s=Demetrios+-+The+BIG+Cynical+Adventure
: 82,409 ± 6,907
http://steamspy.com/search.php?s=SCS+deORBIT
: 660 ± 744
http://steamspy.com/search.php?s=Don't+Starve+Together
: 3,393,938 ± 44,087
http://steamspy.com/search.php?s=Ghoul+Kid
: 1,836 ± 1,269
http://steamspy.com/search.php?s=Avadon+3:+The+Warborn
: 204,732 ± 10,885
http://steamspy.com/search.php?s=Breached
http://steamspy.com/search.php?s=Clustertruck
: 432 ± 844
http://steamspy.com/search.php?s=My+Night+Job
: 911 ± 726
http://steamspy.com/search.php?s=Imhotep,+Pyramid+Builder
: 468 ± 647
http://steamspy.com/search.php?s=WASTED
: 20,792 ± 3,470
http://steamspy.com/search.php?s=Rock+'N'+Roll+Defense
: 176,655 ± 10,112
http://steamspy.com/search.php?s=Gigachess
: 3,187 ± 1,358
http://steamspy.com/search.php?s=Fallout+4
: 3,192,696 ± 42,774
http://steamspy.com/search.php?s=1979+Revolution:+Black+Friday
: 2,732 ± 1,257
http://steamspy.com/search.php?s=Warhammer+40,000:+Eternal+Crusade
: 1,516,140 ± 29,558 
http://steamspy.com/search.php?s=Satellite+Rush
: 459 ± 634
http://steamspy.com/search.php?s=htoL#NiQ:+The+Firefly+Diary
: 459 ± 634
http://steamspy.com/search.php?s=Cosmochoria
: 27,318 ± 3,977
http://steamspy.com/search.php?s=Felt+Tip+Circus
: 20,944 ± 3,482
http://steamspy.com/search.php?s=Frozen+State
: 12,445 ± 2,684
http://steamspy.com/search.php?s=Sniper+Elite+4
: 385,181 ± 14,926
http://steamspy.com/search.php?s=Caveman+World:+Mountains+of+Unga+Boonga
: 28,077 ± 4,032
http://steamspy.com/search.php?s=The+Hero+Project:+Redemption+Season
: 1,366 ± 889
http://steamspy.com/search.php?s=SimplePlanes
: 90,301 ± 7,230
http://steamspy.com/search.php?s=theBlu
: 8,347 ± 2,198
http://steamspy.com/search.php?s=LawBreakers
: 759 ± 662
http://steamspy.com/search.php?s=The+Four+Kings+Casino+and+Slots
: 253,904 ± 12,121
http://steamspy.com/search.php?s=Maui
: 3,671 ± 1,795
http://steamspy.com/search.php?s=Space+Engineers
: 1,730,130 ± 31,564
http://steamspy.com/search.php?s=STAR+WARS+Jedi+Knight:+Mysteries+of+the+Sith
: 89,238 ± 7,188
http://steamspy.com/search.php?s=Tomb+Raider
: 795,101 ± 21,431
http://steamspy.com/search.php?s=Battleborn
http://steamspy.com/search.php?s=Tactical+Craft+Online
: 187,886 ± 10,428
http://steamspy.com/search.php?s=Red+Crucible:+Firestorm
: 1,496,866 ± 29,371
http://steamspy.com/search.php?s=Midvinter
something went wrong
'ascii' codec can't encode character '\xa0' in position 42: ordinal not in range(128)
http://steamspy.com/search.php?s=Orcs+Must+Die!+Unchained (Orcs+Must+Die!+Unchained+-+Open+Beta)
http://steamspy.com/search.php?s=Atari+Vault
: 10,775 ± 2,498
http://steamspy.com/search.php?s=Paint+it+Back
: 3,339 ± 1,390
http://steamspy.com/search.php?s=Worlds+Adrift
: 702 ± 792
http://steamspy.com/search.php?s=Game+Tycoon+2
: 3,491 ± 1,421
http://steamspy.com/search.php?s=Fragments+of+Him
: 432 ± 844
http://steamspy.com/search.php?s=Special+Tactics
: 759 ± 662
http://steamspy.com/search.php?s=Squad
: 485,043 ± 16,747 
http://steamspy.com/search.php?s=The+Black+Death
: 7,285 ± 2,054
http://steamspy.com/search.php?s=Team+Fortress+2
: 33,413,508 ± 131,219
http://steamspy.com/search.php?s=The+Sea+Eternal
: 980 ± 1,356
http://steamspy.com/search.php?s=EasyAntiCheat+eSports
: 256,332 ± 12,179
http://steamspy.com/search.php?s=Niffelheim
: 432 ± 844
http://steamspy.com/search.php?s=Pharaonic
: 459 ± 634
http://steamspy.com/search.php?s=Hero+Defense+-+Haunted+Island
: 7,133 ± 2,032
http://steamspy.com/search.php?s=Ice+Lakes
: 1,319 ± 1,053
http://steamspy.com/search.php?s=The+Inner+Sea
: 880 ± 859
http://steamspy.com/search.php?s=America's+Army:+Proving+Grounds+Beta+(Closed)
: 173,316 ± 10,016
http://steamspy.com/search.php?s=Warbit
: 3,187 ± 1,358
http://steamspy.com/search.php?s=Abandoned+Knight
: 1,428,419 ± 28,695
http://steamspy.com/search.php?s=INVERSUS
http://steamspy.com/search.php?s=Mordheim:+City+of+the+Damned
: 116,556 ± 8,214
http://steamspy.com/search.php?s=Town+of+Salem
: 228,256 ± 11,493
http://steamspy.com/search.php?s=Insecters+War
: 660 ± 744
http://steamspy.com/search.php?s=Two+Worlds:+Epic+Edition
: 828,338 ± 21,873
http://steamspy.com/search.php?s=Block+N+Load
: 1,308,069 ± 27,465
http://steamspy.com/search.php?s=Police+Infinity
: 702 ± 792
http://steamspy.com/search.php?s=Quadrant
: 759 ± 662
http://steamspy.com/search.php?s=Kenshi
: 113,217 ± 8,096
http://steamspy.com/search.php?s=Beyond+The+Destiny
: 448 ± 877
http://steamspy.com/search.php?s=AdVenture+Capitalist
: 3,333,231 ± 43,695

In [47]:
#this gets data from steamspy on price
dfname = df['NAME']
for n in range(len(dfname)):
    game_name = dfname[n]  ##just for example
    game_name=game_name.replace(' ','+')  ### you should probaly do some trial and error and see how much you need to manipulate 
                                            ### your game name so that the code is robust. I just included one exmaple - add %20 instead of space.###
    url_to_scrape = 'http://steamspy.com/search.php?s='+game_name+''
    try:
        req = Request(url_to_scrape, headers={'User-Agent': 'Mozilla/5.0'})
        webpage = urlopen(req).read()
    except Exception as e:
        print ('something went wrong')
        print (e)
    print (url_to_scrape)
    html = BeautifulSoup(webpage, 'html.parser')
    all_strong = html.find_all('strong')
    for strongprice in all_strong:
        if strongprice.text == 'Price:':
            print(strongprice.next.next)
            price = strongprice.next.next
            price = price.replace('$','')
            price = float(price)
            break
    df.loc[(df.NAME== dfname[n]) ,'Price USD'] = price


http://steamspy.com/search.php?s=H1Z1:+Just+Survive+Test+Server
 $19.99 
http://steamspy.com/search.php?s=Yelaxot
 $11.99 
http://steamspy.com/search.php?s=Coffee+Pot+Terrarium
 $14.99 
http://steamspy.com/search.php?s=Kismet
http://steamspy.com/search.php?s=Why+Am+I+Dead+At+Sea
 $9.99 
http://steamspy.com/search.php?s=H1Z1:+King+of+the+Kill+Test+Server
 $19.99 
http://steamspy.com/search.php?s=Steel+Rain
 $9.99 
http://steamspy.com/search.php?s=AltspaceVR
http://steamspy.com/search.php?s=Software+Inc.
 $13.99 
http://steamspy.com/search.php?s=Logic+Missile
 $9.99 
http://steamspy.com/search.php?s=Mr.+Nibbles+Forever
 $19.99 
http://steamspy.com/search.php?s=Lavapools
http://steamspy.com/search.php?s=Hover+Cubes:+Arena
 $19.99 
http://steamspy.com/search.php?s=Share
http://steamspy.com/search.php?s=Zombillie
http://steamspy.com/search.php?s=Skyreach
http://steamspy.com/search.php?s=XCavalypse
http://steamspy.com/search.php?s=I+and+Me
 $9.99 
http://steamspy.com/search.php?s=The+Pit+And+The+Pendulum
 $7.99 
http://steamspy.com/search.php?s=Games+of+Glory
 $9.99 
http://steamspy.com/search.php?s=Kerbal+Space+Program
 $9.99 
http://steamspy.com/search.php?s=Labyrinth
 $1.49 
http://steamspy.com/search.php?s=Block'hood
 $7.99 
http://steamspy.com/search.php?s=Chucks+Challenge+3D
 $3.99 
http://steamspy.com/search.php?s=ARK:+Survival+Of+The+Fittest
 $49.99 
http://steamspy.com/search.php?s=So+Long+Earth
 $6.99 
http://steamspy.com/search.php?s=Zavix+Tower
 $9.99 
http://steamspy.com/search.php?s=Piercing+Blow
 $9.99 
http://steamspy.com/search.php?s=Viking+Squad
 $9.99 
http://steamspy.com/search.php?s=Euclidean
 $4.99 
http://steamspy.com/search.php?s=Falling+Stars:+War+of+Empires
 $9.99 
http://steamspy.com/search.php?s=Pitfall+Planet
 $14.99 
http://steamspy.com/search.php?s=Heroes+of+the+West
 $19.99 
http://steamspy.com/search.php?s=Spunk+and+Moxie
http://steamspy.com/search.php?s=Shiness:+The+Lightning+Kingdom
 $9.99 
something went wrong
'ascii' codec can't encode character '\xa0' in position 32: ordinal not in range(128)
http://steamspy.com/search.php?s=Wevr+Transport (Wevr+Transport)
 $9.99 
http://steamspy.com/search.php?s=Systematic+Immunity
http://steamspy.com/search.php?s=Tyto+Ecology
 $6.99 
http://steamspy.com/search.php?s=Heliborne
 $9.99 
http://steamspy.com/search.php?s=Nelly+Cootalot:+The+Fowl+Fleet
 $19.99 
http://steamspy.com/search.php?s=Sweet+Escape+VR
 $11.99 
http://steamspy.com/search.php?s=A+Quiver+of+Crows
http://steamspy.com/search.php?s=TransOcean+2:+Rivals
 $22.49 
http://steamspy.com/search.php?s=Return+2+Games:+Book+of+Demons
 $9.99 
http://steamspy.com/search.php?s=Divinity:+Original+Sin+Enhanced+Edition
 $9.99 
http://steamspy.com/search.php?s=Darkest+Dungeon
 $24.99 
http://steamspy.com/search.php?s=Man+O'+War:+Corsair
 $29.99 
http://steamspy.com/search.php?s=Worlds
 $9.99 
http://steamspy.com/search.php?s=Demon's+Crystals
 $4.99 
http://steamspy.com/search.php?s=Candle
 $9.99 
http://steamspy.com/search.php?s=Amaranthine
 $2.99 
http://steamspy.com/search.php?s=Vagante
 $14.99 
http://steamspy.com/search.php?s=VEGA+Conflict
 $15.99 
http://steamspy.com/search.php?s=Massive
 $7.99 
http://steamspy.com/search.php?s=The+Forest
 $14.99 
http://steamspy.com/search.php?s=RefRain+-prism+memories-
 $4.99 
http://steamspy.com/search.php?s=Dashy+Square
 $2.99 
http://steamspy.com/search.php?s=Europa+Universalis+IV+Beta
 $9.99 
http://steamspy.com/search.php?s=QUASAR
http://steamspy.com/search.php?s=Kathy+Rain
 $13.49 
http://steamspy.com/search.php?s=FIVE:+Guardians+of+David
 $9.79 
http://steamspy.com/search.php?s=History+in+Letters+-+The+Eternal+Alchemist
 $12.99 
http://steamspy.com/search.php?s=Zero+Gravity
 $9.99 
http://steamspy.com/search.php?s=Master+of+Orion
 $49.99 
http://steamspy.com/search.php?s=Ashes+of+the+Singularity
 $39.99 
http://steamspy.com/search.php?s=Rogue+Wizards
 $9.99 
http://steamspy.com/search.php?s=ASMR+Universe
 $2.99 
http://steamspy.com/search.php?s=Boogeyman
 $7.99 
http://steamspy.com/search.php?s=The+Huntsman:+Winter's+Curse
 $12.99 
http://steamspy.com/search.php?s=Envelop
http://steamspy.com/search.php?s=Zeuxis+:+procedural+texture+generator
 $6.99 
http://steamspy.com/search.php?s=Hide+&+Hold+Out+-+H2o
 $6.99 
http://steamspy.com/search.php?s=Fragmented
 $14.99 
http://steamspy.com/search.php?s=Masquerade:+The+Baubles+of+Doom
 $14.99 
http://steamspy.com/search.php?s=Shroud+of+the+Avatar:+Forsaken+Virtues
 $44.99 
http://steamspy.com/search.php?s=Major\Minor
 $4.99 
http://steamspy.com/search.php?s=Vertigo
 $1.99 
http://steamspy.com/search.php?s=The+Brookhaven+Experiment
 $14.99 
http://steamspy.com/search.php?s=Poly+Bridge
 $11.99 
http://steamspy.com/search.php?s=Stonehearth
 $24.99 
http://steamspy.com/search.php?s=MapleStory
http://steamspy.com/search.php?s=TASTEE:+Lethal+Tactics
 $9.99 
something went wrong
'ascii' codec can't encode character '\xa0' in position 28: ordinal not in range(128)
http://steamspy.com/search.php?s=Necropolis (NECROPOLIS:+A+Diabolical+Dungeon+Delve)
 $9.99 
http://steamspy.com/search.php?s=Superku
http://steamspy.com/search.php?s=Torment:+Tides+of+Numenera
 $44.99 
http://steamspy.com/search.php?s=Homeworld+Remastered+Collection
 $34.99 
http://steamspy.com/search.php?s=Mech+Anarchy
 $7.99 
http://steamspy.com/search.php?s=Walk+The+Light
 $4.99 
http://steamspy.com/search.php?s=R.B.I.+Baseball+16
 $19.99 
http://steamspy.com/search.php?s=Firefall
http://steamspy.com/search.php?s=STAR+WARS+Jedi+Knight:+Jedi+Academy
 $9.99 
http://steamspy.com/search.php?s=Dungeon+Defenders+II
 $14.99 
http://steamspy.com/search.php?s=PULSAR:+Lost+Colony
 $24.99 
http://steamspy.com/search.php?s=Leadwerks+Game+Engine
 $99.99 
http://steamspy.com/search.php?s=Tilt+Brush
 $29.99 
http://steamspy.com/search.php?s=Aurion:+Legacy+of+the+Kori-Odan
 $4.99 
http://steamspy.com/search.php?s=Initia:+Elemental+Arena
 $19.99 
http://steamspy.com/search.php?s=Cyberpong+VR
 $19.99 
something went wrong
'ascii' codec can't encode character '\xa0' in position 31: ordinal not in range(128)
http://steamspy.com/search.php?s=Rocket+League (Rocket+League)
 $19.99 
http://steamspy.com/search.php?s=Ticket+to+Ride
 $9.99 
http://steamspy.com/search.php?s=Natural+Selection+2
 $9.99 
http://steamspy.com/search.php?s=WARSHIFT
 $8.99 
http://steamspy.com/search.php?s=SolForge
http://steamspy.com/search.php?s=Ultimate+Fight+Manager+2016
 $4.99 
http://steamspy.com/search.php?s=RWBY:+Grimm+Eclipse
 $14.99 
http://steamspy.com/search.php?s=Death+by+Game+Show
 $9.99 
http://steamspy.com/search.php?s=The+Banner+Saga+2
 $19.99 
http://steamspy.com/search.php?s=BigScreen+Beta
 $10.04 
http://steamspy.com/search.php?s=The+SKIES
 $9.99 
http://steamspy.com/search.php?s=STAR+WARS+Rebellion
 $4.99 
something went wrong
'ascii' codec can't encode character '\xa0' in position 41: ordinal not in range(128)
http://steamspy.com/search.php?s=Rise+of+the+Tomb+Raider (Rise+of+the+Tomb+Raider)
 $4.99 
http://steamspy.com/search.php?s=Tom+Clancy's+Rainbow+Six+Siege
 $14.99 
http://steamspy.com/search.php?s=The+Isle
 $19.99 
http://steamspy.com/search.php?s=3030+Deathwar+Redux
 $9.99 
http://steamspy.com/search.php?s=Super+Time+Force+Ultra
 $14.99 
http://steamspy.com/search.php?s=Fahrenheit:+Indigo+Prophecy+Remastered
 $9.99 
http://steamspy.com/search.php?s=The+Culling
 $12.99 
http://steamspy.com/search.php?s=Two+Worlds+II
 $19.99 
http://steamspy.com/search.php?s=Choice+Chamber
 $9.99 
http://steamspy.com/search.php?s=Age+of+Mythology:+Extended+Edition
 $29.99 
http://steamspy.com/search.php?s=Holopoint
 $7.99 
http://steamspy.com/search.php?s=Lifeless
 $19.99 
http://steamspy.com/search.php?s=Savage+Lands
 $14.99 
http://steamspy.com/search.php?s=Castle+Story
 $19.99 
http://steamspy.com/search.php?s=VirZOOM
http://steamspy.com/search.php?s=Deus+Ex:+Mankind+Divided
 $6.99 
http://steamspy.com/search.php?s=Subnautica
 $19.99 
http://steamspy.com/search.php?s=ARK:+Survival+Evolved
 $29.99 
http://steamspy.com/search.php?s=FEZ
 $9.99 
http://steamspy.com/search.php?s=Brigador
 $19.99 
http://steamspy.com/search.php?s=Substance+Painter+2
 $149.99 
http://steamspy.com/search.php?s=Tempest
 $11.99 
http://steamspy.com/search.php?s=Experience
 $9.99 
http://steamspy.com/search.php?s=TableTop+Soccer
 $3.99 
http://steamspy.com/search.php?s=Prison+Architect
 $29.99 
http://steamspy.com/search.php?s=Sir!+I'd+Like+To+Report+A+Bug!
 $1.99 
http://steamspy.com/search.php?s=Unveil
 $14.99 
http://steamspy.com/search.php?s=Avalon+Lords:+Dawn+Rises
 $12.99 
http://steamspy.com/search.php?s=RPG+Tycoon
 $7.49 
http://steamspy.com/search.php?s=Parkitect
http://steamspy.com/search.php?s=Blood+and+Bacon
 $0.99 
something went wrong
'ascii' codec can't encode character '\xa0' in position 24: ordinal not in range(128)
http://steamspy.com/search.php?s=XCOM+2 (XCOM®+2)
 $0.99 
http://steamspy.com/search.php?s=Minecraft:+Story+Mode+-+A+Telltale+Games+Series
 $24.99 
http://steamspy.com/search.php?s=Catlateral+Damage
 $9.99 
http://steamspy.com/search.php?s=The+Count+Lucanor
 $9.99 
http://steamspy.com/search.php?s=The+Song+of+Seven+:+Chapter+One
 $19.99 
http://steamspy.com/search.php?s=Offworld+Trading+Company
 $39.99 
http://steamspy.com/search.php?s=Robocraft
http://steamspy.com/search.php?s=Torgar's+Quest
 $14.99 
http://steamspy.com/search.php?s=Bell+Ringer
 $6.99 
http://steamspy.com/search.php?s=Sword+Coast+Legends
 $19.99 
http://steamspy.com/search.php?s=Out+of+the+Park+Baseball+17
 $39.99 
http://steamspy.com/search.php?s=DCS+World
 $4.99 
http://steamspy.com/search.php?s=Epic+Clicker+Journey
 $9.99 
http://steamspy.com/search.php?s=Football+Tactics
 $14.99 
http://steamspy.com/search.php?s=Blacksea+Odyssey
 $9.99 
http://steamspy.com/search.php?s=Marvel+Heroes+2016
 $19.99 
http://steamspy.com/search.php?s=KeeperRL
 $14.99 
http://steamspy.com/search.php?s=Link
 $9.99 
http://steamspy.com/search.php?s=Insane+Decay+of+Mind
 $14.99 
http://steamspy.com/search.php?s=CHKN
 $14.99 
http://steamspy.com/search.php?s=Dota+2
 $4.99 
http://steamspy.com/search.php?s=Grim+Dawn
 $24.99 
http://steamspy.com/search.php?s=HoloBall
 $5.99 
http://steamspy.com/search.php?s=Space+Food+Truck
 $19.99 
http://steamspy.com/search.php?s=Rust
 $24.99 
http://steamspy.com/search.php?s=Bounty+Train
 $24.99 
http://steamspy.com/search.php?s=The+Detail
 $5.99 
http://steamspy.com/search.php?s=Nevermind
 $19.99 
http://steamspy.com/search.php?s=Babel:+Tower+to+the+Gods
 $9.99 
http://steamspy.com/search.php?s=iOMoon
http://steamspy.com/search.php?s=Factorio
 $20 
http://steamspy.com/search.php?s=Ghost+in+the+Shell+Stand+Alone+Complex+First+Assault+Online
 $4.99 
something went wrong
'ascii' codec can't encode character '\xe3' in position 36: ordinal not in range(128)
http://steamspy.com/search.php?s=Pesadelo+-+Regressão
 $4.99 
http://steamspy.com/search.php?s=Second+Warfare
 $14.99 
http://steamspy.com/search.php?s=The+Fifth+Expedition
 $9.99 
http://steamspy.com/search.php?s=Big+Pharma
 $14.99 
http://steamspy.com/search.php?s=Three+Days
 $9.99 
http://steamspy.com/search.php?s=Holodrive
 $9.99 
http://steamspy.com/search.php?s=Ballistic+Overkill
 $6.99 
http://steamspy.com/search.php?s=Counter+Spell
 $6.99 
http://steamspy.com/search.php?s=Barbie+Dreamhouse+Party
 $4.99 
http://steamspy.com/search.php?s=The+Mims+Beginning
 $19.99 
http://steamspy.com/search.php?s=Armello
 $19.99 
http://steamspy.com/search.php?s=DOOM
 $4.99 
http://steamspy.com/search.php?s=Demetrios+-+The+BIG+Cynical+Adventure
 $4.99 
http://steamspy.com/search.php?s=SCS+deORBIT
 $4.99 
http://steamspy.com/search.php?s=Don't+Starve+Together
 $7.49 
http://steamspy.com/search.php?s=Ghoul+Kid
 $14.99 
http://steamspy.com/search.php?s=Avadon+3:+The+Warborn
 $9.99 
http://steamspy.com/search.php?s=Breached
http://steamspy.com/search.php?s=Clustertruck
http://steamspy.com/search.php?s=My+Night+Job
 $6.39 
http://steamspy.com/search.php?s=Imhotep,+Pyramid+Builder
 $59.99 
http://steamspy.com/search.php?s=WASTED
 $4.99 
http://steamspy.com/search.php?s=Rock+'N'+Roll+Defense
 $9.99 
http://steamspy.com/search.php?s=Gigachess
 $1.99 
http://steamspy.com/search.php?s=Fallout+4
 $59.99 
http://steamspy.com/search.php?s=1979+Revolution:+Black+Friday
 $11.99 
http://steamspy.com/search.php?s=Warhammer+40,000:+Eternal+Crusade
 $12.99 
http://steamspy.com/search.php?s=Satellite+Rush
 $4.99 
http://steamspy.com/search.php?s=htoL#NiQ:+The+Firefly+Diary
http://steamspy.com/search.php?s=Cosmochoria
 $9.99 
http://steamspy.com/search.php?s=Felt+Tip+Circus
 $7.99 
http://steamspy.com/search.php?s=Frozen+State
 $9.99 
http://steamspy.com/search.php?s=Sniper+Elite+4
 $9.99 
http://steamspy.com/search.php?s=Caveman+World:+Mountains+of+Unga+Boonga
 $4.99 
http://steamspy.com/search.php?s=The+Hero+Project:+Redemption+Season
 $3.99 
http://steamspy.com/search.php?s=SimplePlanes
 $12.99 
http://steamspy.com/search.php?s=theBlu
 $9.99 
http://steamspy.com/search.php?s=LawBreakers
http://steamspy.com/search.php?s=The+Four+Kings+Casino+and+Slots
 $0.99 
http://steamspy.com/search.php?s=Maui
http://steamspy.com/search.php?s=Space+Engineers
 $24.99 
http://steamspy.com/search.php?s=STAR+WARS+Jedi+Knight:+Mysteries+of+the+Sith
 $4.99 
http://steamspy.com/search.php?s=Tomb+Raider
 $6.99 
http://steamspy.com/search.php?s=Battleborn
http://steamspy.com/search.php?s=Tactical+Craft+Online
 $19.99 
http://steamspy.com/search.php?s=Red+Crucible:+Firestorm
http://steamspy.com/search.php?s=Midvinter
something went wrong
'ascii' codec can't encode character '\xa0' in position 42: ordinal not in range(128)
http://steamspy.com/search.php?s=Orcs+Must+Die!+Unchained (Orcs+Must+Die!+Unchained+-+Open+Beta)
http://steamspy.com/search.php?s=Atari+Vault
 $19.99 
http://steamspy.com/search.php?s=Paint+it+Back
 $5.99 
http://steamspy.com/search.php?s=Worlds+Adrift
 $9.99 
http://steamspy.com/search.php?s=Game+Tycoon+2
 $14.99 
http://steamspy.com/search.php?s=Fragments+of+Him
 $9.99 
http://steamspy.com/search.php?s=Special+Tactics
 $8.99 
http://steamspy.com/search.php?s=Squad
 $9.99 
http://steamspy.com/search.php?s=The+Black+Death
 $19.99 
http://steamspy.com/search.php?s=Team+Fortress+2
 $4.99 
http://steamspy.com/search.php?s=The+Sea+Eternal
 $2.99 
http://steamspy.com/search.php?s=EasyAntiCheat+eSports
http://steamspy.com/search.php?s=Niffelheim
http://steamspy.com/search.php?s=Pharaonic
 $12.99 
http://steamspy.com/search.php?s=Hero+Defense+-+Haunted+Island
 $14.99 
http://steamspy.com/search.php?s=Ice+Lakes
 $14.99 
http://steamspy.com/search.php?s=The+Inner+Sea
 $11.99 
http://steamspy.com/search.php?s=America's+Army:+Proving+Grounds+Beta+(Closed)
 $14.99 
http://steamspy.com/search.php?s=Warbit
 $0.99 
http://steamspy.com/search.php?s=Abandoned+Knight
 $1.99 
http://steamspy.com/search.php?s=INVERSUS
http://steamspy.com/search.php?s=Mordheim:+City+of+the+Damned
 $39.99 
http://steamspy.com/search.php?s=Town+of+Salem
 $4.99 
http://steamspy.com/search.php?s=Insecters+War
 $5.99 
http://steamspy.com/search.php?s=Two+Worlds:+Epic+Edition
 $9.99 
http://steamspy.com/search.php?s=Block+N+Load
 $4.99 
http://steamspy.com/search.php?s=Police+Infinity
 $6.99 
http://steamspy.com/search.php?s=Quadrant
 $3.99 
http://steamspy.com/search.php?s=Kenshi
 $19.99 
http://steamspy.com/search.php?s=Beyond+The+Destiny
 $29.99 
http://steamspy.com/search.php?s=AdVenture+Capitalist
 $4.99 

In [85]:
#This gets data from steamspy for playtime total average
dfapp = df['APPID']
for n in range(len(dfapp)):
    game_name = dfapp[n]  ##just for example
    #game_name=game_name.replace(' ','+')  ### you should probaly do some trial and error and see how much you need to manipulate 
                                            ### your game name so that the code is robust. I just included one exmaple - add %20 instead of space.###
    url_to_scrape = 'http://steamspy.com/app/'+str(game_name)
    try:
        req = Request(url_to_scrape, headers={'User-Agent': 'Mozilla/5.0'})
        webpage = urlopen(req).read()
    except Exception as e:
        print ('something went wrong')
        print (e)
    print (url_to_scrape)
    html = BeautifulSoup(webpage, 'html.parser')
    all_strong = html.find_all('strong')
    #print (all_strong)
    play=0
    for strongplay in all_strong:
        #print (strongplay)
        if 'Playtime' in strongplay.text :
            found =True
            print(strongplay.next.next)
            play = strongplay.next.next
            play = play.replace(':','.')
            play, sep, tail = play.partition(' (average)')
            play = float(play)
            break
    df.loc[(df.NAME== dfname[n]) ,'Total Playtime (hrs)'] = play


http://steamspy.com/app/362300
 00:37 (average) 00:05 (median) 
http://steamspy.com/app/340820
 02:32 (average) 01:32 (median) 
http://steamspy.com/app/444020
http://steamspy.com/app/463290
http://steamspy.com/app/359400
 07:02 (average) 08:33 (median) 
http://steamspy.com/app/439700
 01:07 (average) 00:24 (median) 
http://steamspy.com/app/387240
 06:01 (average) 06:01 (median) 
http://steamspy.com/app/407060
 00:36 (average) 00:32 (median) 
http://steamspy.com/app/362620
 04:01 (average) 02:43 (median) 
http://steamspy.com/app/448300
http://steamspy.com/app/448050
 00:09 (average) 00:09 (median) 
http://steamspy.com/app/401510
http://steamspy.com/app/396700
http://steamspy.com/app/448020
http://steamspy.com/app/456810
http://steamspy.com/app/461970
http://steamspy.com/app/447960
http://steamspy.com/app/399600
http://steamspy.com/app/463050
http://steamspy.com/app/342150
 02:21 (average) 00:40 (median) 
http://steamspy.com/app/220200
http://steamspy.com/app/412310
 00:29 (average) 00:29 (median) 
http://steamspy.com/app/416210
 03:41 (average) 06:00 (median) 
http://steamspy.com/app/262590
 04:48 (average) 01:14 (median) 
http://steamspy.com/app/407530
 02:29 (average) 00:27 (median) 
http://steamspy.com/app/448110
 00:33 (average) 00:33 (median) 
http://steamspy.com/app/427910
 03:28 (average) 01:17 (median) 
http://steamspy.com/app/382850
 08:47 (average) 01:30 (median) 
http://steamspy.com/app/325930
http://steamspy.com/app/398180
 00:10 (average) 00:12 (median) 
http://steamspy.com/app/439960
http://steamspy.com/app/464900
http://steamspy.com/app/440090
 00:01 (average) 00:01 (median) 
http://steamspy.com/app/449310
 00:20 (average) 00:20 (median) 
http://steamspy.com/app/366640
http://steamspy.com/app/450360
http://steamspy.com/app/395100
http://steamspy.com/app/453750
 01:51 (average) 01:00 (median) 
http://steamspy.com/app/433530
 00:47 (average) 00:34 (median) 
http://steamspy.com/app/317320
 00:08 (average) 00:08 (median) 
http://steamspy.com/app/462480
 00:01 (average) 00:01 (median) 
http://steamspy.com/app/347280
http://steamspy.com/app/350110
http://steamspy.com/app/449960
http://steamspy.com/app/373420
 09:49 (average) 03:27 (median) 
http://steamspy.com/app/262060
 06:08 (average) 01:52 (median) 
http://steamspy.com/app/344240
 02:09 (average) 01:50 (median) 
http://steamspy.com/app/304850
http://steamspy.com/app/454610
 00:02 (average) 00:02 (median) 
http://steamspy.com/app/420060
 00:13 (average) 00:13 (median) 
http://steamspy.com/app/454900
 03:32 (average) 03:32 (median) 
http://steamspy.com/app/323220
 02:35 (average) 02:16 (median) 
http://steamspy.com/app/339600
 18:58 (average) 06:58 (median) 
http://steamspy.com/app/461400
http://steamspy.com/app/242760
 04:13 (average) 01:25 (median) 
http://steamspy.com/app/435970
http://steamspy.com/app/461230
 01:02 (average) 01:34 (median) 
http://steamspy.com/app/222260
http://steamspy.com/app/375740
http://steamspy.com/app/370910
 00:20 (average) 00:20 (median) 
http://steamspy.com/app/387010
 02:45 (average) 02:47 (median) 
http://steamspy.com/app/318680
http://steamspy.com/app/423780
http://steamspy.com/app/298050
 09:15 (average) 05:02 (median) 
http://steamspy.com/app/228880
 05:11 (average) 02:05 (median) 
http://steamspy.com/app/392260
http://steamspy.com/app/448830
 06:25 (average) 06:25 (median) 
http://steamspy.com/app/412770
 00:25 (average) 00:25 (median) 
http://steamspy.com/app/446990
 00:26 (average) 00:25 (median) 
http://steamspy.com/app/372650
http://steamspy.com/app/366550
 06:38 (average) 13:05 (median) 
http://steamspy.com/app/377140
 12:31 (average) 05:15 (median) 
http://steamspy.com/app/441790
 01:11 (average) 00:47 (median) 
http://steamspy.com/app/299380
 04:48 (average) 04:48 (median) 
http://steamspy.com/app/326160
 11:29 (average) 11:37 (median) 
http://steamspy.com/app/417990
 03:04 (average) 05:37 (median) 
http://steamspy.com/app/465430
http://steamspy.com/app/440630
 00:27 (average) 00:27 (median) 
http://steamspy.com/app/367450
 02:41 (average) 00:25 (median) 
http://steamspy.com/app/253250
 03:17 (average) 00:53 (median) 
http://steamspy.com/app/216150
 12:57 (average) 01:04 (median) 
http://steamspy.com/app/365190
 00:17 (average) 00:17 (median) 
http://steamspy.com/app/384490
http://steamspy.com/app/407570
http://steamspy.com/app/272270
 00:25 (average) 00:38 (median) 
http://steamspy.com/app/244160
 03:44 (average) 01:08 (median) 
http://steamspy.com/app/420900
 05:09 (average) 05:12 (median) 
http://steamspy.com/app/428130
http://steamspy.com/app/407690
 03:11 (average) 04:04 (median) 
http://steamspy.com/app/227700
 06:38 (average) 01:11 (median) 
http://steamspy.com/app/6020
 02:29 (average) 00:45 (median) 
http://steamspy.com/app/236110
 05:57 (average) 01:24 (median) 
http://steamspy.com/app/252870
 03:56 (average) 02:47 (median) 
http://steamspy.com/app/251810
 09:49 (average) 17:47 (median) 
http://steamspy.com/app/327140
 01:26 (average) 00:26 (median) 
http://steamspy.com/app/368080
 09:39 (average) 09:51 (median) 
http://steamspy.com/app/463920
http://steamspy.com/app/462000
http://steamspy.com/app/252950
 07:11 (average) 03:22 (median) 
http://steamspy.com/app/108200
 04:13 (average) 00:57 (median) 
http://steamspy.com/app/4920
 03:53 (average) 01:18 (median) 
http://steamspy.com/app/392580
 00:37 (average) 00:46 (median) 
http://steamspy.com/app/232450
 12:14 (average) 04:45 (median) 
http://steamspy.com/app/454560
http://steamspy.com/app/418340
 01:06 (average) 00:28 (median) 
http://steamspy.com/app/409730
 01:15 (average) 01:15 (median) 
http://steamspy.com/app/281640
 08:08 (average) 05:49 (median) 
http://steamspy.com/app/457550
http://steamspy.com/app/337950
 01:21 (average) 00:25 (median) 
http://steamspy.com/app/441550
 04:25 (average) 06:36 (median) 
http://steamspy.com/app/391220
 04:54 (average) 01:41 (median) 
http://steamspy.com/app/359550
 11:43 (average) 05:18 (median) 
http://steamspy.com/app/376210
 11:27 (average) 02:29 (median) 
http://steamspy.com/app/464360
http://steamspy.com/app/250700
 01:13 (average) 01:23 (median) 
http://steamspy.com/app/312840
 02:11 (average) 00:56 (median) 
http://steamspy.com/app/437220
 05:01 (average) 01:13 (median) 
http://steamspy.com/app/7520
 04:32 (average) 02:38 (median) 
http://steamspy.com/app/359960
 01:19 (average) 01:23 (median) 
http://steamspy.com/app/266840
 05:10 (average) 01:40 (median) 
http://steamspy.com/app/457960
 01:24 (average) 00:37 (median) 
http://steamspy.com/app/419520
 00:19 (average) 00:19 (median) 
http://steamspy.com/app/307880
 02:21 (average) 00:31 (median) 
http://steamspy.com/app/227860
 05:37 (average) 01:00 (median) 
http://steamspy.com/app/448710
http://steamspy.com/app/337000
http://steamspy.com/app/264710
 04:34 (average) 01:25 (median) 
http://steamspy.com/app/346110
 20:25 (average) 05:44 (median) 
http://steamspy.com/app/224760
 01:15 (average) 00:25 (median) 
http://steamspy.com/app/274500
 00:23 (average) 00:23 (median) 
http://steamspy.com/app/454510
 05:52 (average) 02:55 (median) 
http://steamspy.com/app/418180
 02:57 (average) 03:07 (median) 
http://steamspy.com/app/463040
http://steamspy.com/app/453710
 02:35 (average) 03:11 (median) 
http://steamspy.com/app/233450
 06:17 (average) 01:32 (median) 
http://steamspy.com/app/393240
 00:52 (average) 00:52 (median) 
http://steamspy.com/app/375210
 03:26 (average) 04:00 (median) 
http://steamspy.com/app/329280
http://steamspy.com/app/314240
 00:15 (average) 00:15 (median) 
http://steamspy.com/app/453090
http://steamspy.com/app/434570
 01:56 (average) 01:38 (median) 
http://steamspy.com/app/268500
 11:10 (average) 04:09 (median) 
http://steamspy.com/app/376870
 04:37 (average) 01:16 (median) 
http://steamspy.com/app/329860
 00:42 (average) 00:57 (median) 
http://steamspy.com/app/440880
 01:16 (average) 02:32 (median) 
http://steamspy.com/app/433590
http://steamspy.com/app/271240
 06:50 (average) 03:06 (median) 
http://steamspy.com/app/301520
 04:50 (average) 01:09 (median) 
http://steamspy.com/app/448810
http://steamspy.com/app/424830
 03:26 (average) 03:33 (median) 
http://steamspy.com/app/325600
 05:03 (average) 01:30 (median) 
http://steamspy.com/app/402430
 31:43 (average) 15:48 (median) 
http://steamspy.com/app/223750
 02:25 (average) 00:16 (median) 
http://steamspy.com/app/414730
 01:59 (average) 00:39 (median) 
http://steamspy.com/app/375530
 13:26 (average) 15:32 (median) 
http://steamspy.com/app/369550
 03:26 (average) 03:26 (median) 
http://steamspy.com/app/226320
 09:44 (average) 01:36 (median) 
http://steamspy.com/app/329970
 02:26 (average) 03:11 (median) 
http://steamspy.com/app/454030
 00:26 (average) 00:27 (median) 
http://steamspy.com/app/450060
http://steamspy.com/app/420930
 00:56 (average) 00:26 (median) 
http://steamspy.com/app/570
 22:36 (average) 13:19 (median) 
http://steamspy.com/app/219990
 17:00 (average) 06:44 (median) 
http://steamspy.com/app/457320
 00:29 (average) 00:33 (median) 
http://steamspy.com/app/397390
 02:44 (average) 03:27 (median) 
http://steamspy.com/app/252490
 15:30 (average) 04:11 (median) 
http://steamspy.com/app/371520
 00:42 (average) 01:08 (median) 
http://steamspy.com/app/319970
 02:35 (average) 01:46 (median) 
http://steamspy.com/app/342260
 05:04 (average) 05:04 (median) 
http://steamspy.com/app/441230
 01:23 (average) 01:23 (median) 
http://steamspy.com/app/465450
http://steamspy.com/app/427520
 17:29 (average) 08:46 (median) 
http://steamspy.com/app/369200
 02:30 (average) 00:39 (median) 
http://steamspy.com/app/378930
 06:49 (average) 13:11 (median) 
http://steamspy.com/app/372740
 06:41 (average) 06:41 (median) 
http://steamspy.com/app/453030
http://steamspy.com/app/344850
 03:52 (average) 01:57 (median) 
http://steamspy.com/app/375580
 00:13 (average) 00:13 (median) 
http://steamspy.com/app/370770
 00:25 (average) 00:25 (median) 
http://steamspy.com/app/296300
 05:44 (average) 04:03 (median) 
http://steamspy.com/app/351230
 03:15 (average) 03:28 (median) 
http://steamspy.com/app/251610
 38:59 (average) 77:15 (median) 
http://steamspy.com/app/337820
 03:26 (average) 02:29 (median) 
http://steamspy.com/app/290340
 02:22 (average) 01:18 (median) 
http://steamspy.com/app/379720
http://steamspy.com/app/451570
http://steamspy.com/app/337700
 00:25 (average) 00:40 (median) 
http://steamspy.com/app/322330
 05:01 (average) 02:00 (median) 
http://steamspy.com/app/461750
 00:05 (average) 00:10 (median) 
http://steamspy.com/app/460780
http://steamspy.com/app/460640
http://steamspy.com/app/397950
 01:06 (average) 01:06 (median) 
http://steamspy.com/app/437100
 00:36 (average) 00:36 (median) 
http://steamspy.com/app/448730
http://steamspy.com/app/327510
 09:40 (average) 09:40 (median) 
http://steamspy.com/app/438480
 04:21 (average) 04:23 (median) 
http://steamspy.com/app/415910
 02:15 (average) 02:15 (median) 
http://steamspy.com/app/377160
 11:35 (average) 03:22 (median) 
http://steamspy.com/app/388320
 02:26 (average) 02:52 (median) 
http://steamspy.com/app/375230
 02:37 (average) 00:47 (median) 
http://steamspy.com/app/429350
http://steamspy.com/app/368640
 10:24 (average) 10:24 (median) 
http://steamspy.com/app/293240
 01:28 (average) 02:21 (median) 
http://steamspy.com/app/427890
 00:27 (average) 00:28 (median) 
http://steamspy.com/app/270270
 01:27 (average) 02:12 (median) 
http://steamspy.com/app/312660
http://steamspy.com/app/462960
http://steamspy.com/app/459310
 05:01 (average) 05:01 (median) 
http://steamspy.com/app/397340
 05:47 (average) 01:04 (median) 
http://steamspy.com/app/451520
 00:35 (average) 00:36 (median) 
http://steamspy.com/app/350280
 65:22 (average) 65:22 (median) 
http://steamspy.com/app/260430
 03:09 (average) 00:31 (median) 
http://steamspy.com/app/464700
 00:08 (average) 00:07 (median) 
http://steamspy.com/app/244850
 09:00 (average) 02:02 (median) 
http://steamspy.com/app/32390
 00:21 (average) 00:04 (median) 
http://steamspy.com/app/203160
 03:11 (average) 00:49 (median) 
http://steamspy.com/app/394230
http://steamspy.com/app/415860
 03:06 (average) 00:09 (median) 
http://steamspy.com/app/298240
 01:32 (average) 00:22 (median) 
http://steamspy.com/app/452120
http://steamspy.com/app/427270
 04:26 (average) 00:54 (median) 
http://steamspy.com/app/400020
 00:18 (average) 00:23 (median) 
http://steamspy.com/app/385250
 01:12 (average) 01:23 (median) 
http://steamspy.com/app/322780
 01:25 (average) 01:25 (median) 
http://steamspy.com/app/404640
 00:50 (average) 00:50 (median) 
http://steamspy.com/app/428540
http://steamspy.com/app/432870
 00:03 (average) 00:03 (median) 
http://steamspy.com/app/393380
 04:57 (average) 01:27 (median) 
http://steamspy.com/app/412450
 02:52 (average) 01:26 (median) 
http://steamspy.com/app/440
 09:08 (average) 02:57 (median) 
http://steamspy.com/app/463320
 01:03 (average) 01:03 (median) 
http://steamspy.com/app/282660
 09:27 (average) 02:38 (median) 
http://steamspy.com/app/351100
 00:07 (average) 00:07 (median) 
http://steamspy.com/app/386080
 00:22 (average) 00:22 (median) 
http://steamspy.com/app/423620
 00:49 (average) 01:03 (median) 
http://steamspy.com/app/393430
 02:22 (average) 03:47 (median) 
http://steamspy.com/app/443700
 00:10 (average) 00:18 (median) 
http://steamspy.com/app/239490
 06:55 (average) 06:55 (median) 
http://steamspy.com/app/454150
 00:09 (average) 00:11 (median) 
http://steamspy.com/app/444790
http://steamspy.com/app/432980
http://steamspy.com/app/276810
 10:53 (average) 04:21 (median) 
http://steamspy.com/app/334230
 05:35 (average) 01:50 (median) 
http://steamspy.com/app/335950
 04:29 (average) 04:29 (median) 
http://steamspy.com/app/1930
 08:49 (average) 02:19 (median) 
http://steamspy.com/app/299360
 03:21 (average) 00:45 (median) 
http://steamspy.com/app/384960
 03:33 (average) 03:33 (median) 
http://steamspy.com/app/365320
 02:00 (average) 03:24 (median) 
http://steamspy.com/app/233860
 04:34 (average) 02:09 (median) 
http://steamspy.com/app/436410
http://steamspy.com/app/346900
 10:14 (average) 00:41 (median) 

In [75]:
'Playtime' in all_strong[-1]


Out[75]:
False

In [ ]:


In [34]:
#This is a test section
    game_name = 'Dota 2'  ##just for example
    game_name=game_name.replace(' ','+')  ### you should probaly do some trial and error and see how much you need to manipulate 
                                            ### your game name so that the code is robust. I just included one exmaple - add %20 instead of space.###
    url_to_scrape = 'http://steamspy.com/search.php?s='+game_name+''
    try:
        req = Request(url_to_scrape, headers={'User-Agent': 'Mozilla/5.0'})
        webpage = urlopen(req).read()
    except Exception as e:
        print ('something went wrong')
        print (e)
    #print (url_to_scrape)
    html = BeautifulSoup(webpage, 'html.parser')
    all_strong = html.find_all('strong')
    for strongowners in all_strong:
        if strongowners.text == 'Owners':
            print(strongowners.next.next)
            brezz
    ownersnum = strongowners.next.next
    ownersnum = ownersnum.replace(': ','')
    ownersnum = ownersnum.replace(',','')
    ownersnum, sep, tail = ownersnum.partition(' ±')
    ownersnum = int(ownersnum)
    print(ownersnum)


something went wrong
HTTP Error 522: Origin Connection Time-out
: 69,004,323 ± 176,095
69004323

In [88]:
df


Out[88]:
APPID NAME SCORE # of Owners Price USD Total Playtime (hrs)
0 362300 H1Z1: Just Survive Test Server NaN 411740 19.99 0.37
1 340820 Yelaxot NaN 5312 11.99 2.32
2 444020 Coffee Pot Terrarium NaN 5312 14.99 0.00
3 463290 Kismet NaN 863 14.99 0.00
4 359400 Why Am I Dead At Sea NaN 2125 9.99 7.02
5 439700 H1Z1: King of the Kill Test Server NaN 2544960 19.99 1.07
6 387240 Steel Rain NaN 9561 9.99 6.01
7 407060 AltspaceVR NaN 14721 9.99 0.36
8 362620 Software Inc. NaN 40825 13.99 4.01
9 448300 Logic Missile NaN 911 9.99 0.00
10 448050 Mr. Nibbles Forever NaN 880 19.99 0.09
11 401510 Lavapools NaN 490 19.99 0.00
12 396700 Hover Cubes: Arena NaN 306719 19.99 0.00
13 448020 Share 59.0 108816 19.99 0.00
14 456810 Zombillie NaN 108816 19.99 0.00
15 461970 Skyreach NaN 108816 19.99 0.00
16 447960 XCavalypse NaN 108816 19.99 0.00
17 399600 I and Me 93.0 947777 9.99 0.00
18 463050 The Pit And The Pendulum NaN 459 7.99 0.00
19 342150 Games of Glory NaN 140080 9.99 2.21
20 220200 Kerbal Space Program 88.0 64349 9.99 0.00
21 412310 Labyrinth 98.0 4705 1.49 0.29
22 416210 Block'hood NaN 97130 7.99 3.41
23 262590 Chucks Challenge 3D NaN 21399 3.99 4.48
24 407530 ARK: Survival Of The Fittest NaN 1474253 49.99 2.29
25 448110 So Long Earth NaN 490 6.99 0.33
26 427910 Zavix Tower NaN 26863 9.99 3.28
27 382850 Piercing Blow NaN 322806 9.99 8.47
28 325930 Viking Squad NaN 485043 9.99 0.00
29 398180 Euclidean 65.0 5615 4.99 0.10
... ... ... ... ... ... ...
221 400020 Atari Vault NaN 10775 19.99 0.18
222 385250 Paint it Back 84.0 3339 5.99 1.12
223 322780 Worlds Adrift NaN 702 9.99 1.25
224 404640 Game Tycoon 2 NaN 3491 14.99 0.50
225 428540 Fragments of Him NaN 432 9.99 0.00
226 432870 Special Tactics NaN 759 8.99 0.03
227 393380 Squad 68.0 485043 9.99 4.57
228 412450 The Black Death 42.0 7285 19.99 2.52
229 440 Team Fortress 2 92.0 33413508 4.99 9.08
230 463320 The Sea Eternal NaN 980 2.99 1.03
231 282660 EasyAntiCheat eSports NaN 256332 2.99 9.27
232 351100 Niffelheim NaN 432 2.99 0.07
233 386080 Pharaonic NaN 459 12.99 0.22
234 423620 Hero Defense - Haunted Island NaN 7133 14.99 0.49
235 393430 Ice Lakes NaN 1319 14.99 2.22
236 443700 The Inner Sea NaN 880 11.99 0.10
237 239490 America's Army: Proving Grounds Beta (Closed) NaN 173316 14.99 6.55
238 454150 Warbit 93.0 3187 0.99 0.09
239 444790 Abandoned Knight NaN 1428419 1.99 0.00
240 432980 INVERSUS NaN 1428419 1.99 0.00
241 276810 Mordheim: City of the Damned 74.0 116556 39.99 10.53
242 334230 Town of Salem NaN 228256 4.99 5.35
243 335950 Insecters War NaN 660 5.99 4.29
244 1930 Two Worlds: Epic Edition NaN 828338 9.99 8.49
245 299360 Block N Load 72.0 1308069 4.99 3.21
246 384960 Police Infinity NaN 702 6.99 3.33
247 365320 Quadrant NaN 759 3.99 2.00
248 233860 Kenshi NaN 113217 19.99 4.34
249 436410 Beyond The Destiny NaN 448 29.99 0.00
250 346900 AdVenture Capitalist NaN 3333231 4.99 10.14

251 rows × 6 columns


In [29]:
#This is a test section
    all_strong = html.find_all('strong')
owners = all_strong[8]
ownersnum = owners.next.next
print (ownersnum)
ownersnum = ownersnum.replace(': ','')
ownersnum = ownersnum.replace(',','')
ownersnum, sep, tail = ownersnum.partition(' ±')
ownersnum = int(ownersnum)
print(ownersnum)


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-29-889a1afda9d7> in <module>()
      1 all_strong = html.find_all('strong')
----> 2 owners = all_strong[8]
      3 ownersnum = owners.next.next
      4 print (ownersnum)
      5 ownersnum = ownersnum.replace(': ','')

IndexError: list index out of range

In [38]:
df


Out[38]:
APPID NAME SCORE # of Owners
0 362300 H1Z1: Just Survive Test Server NaN $14.99
1 340820 Yelaxot NaN $14.99
2 444020 Coffee Pot Terrarium NaN $14.99
3 463290 Kismet NaN $14.99
4 359400 Why Am I Dead At Sea NaN 1990
5 439700 H1Z1: King of the Kill Test Server NaN 2512082
6 387240 Steel Rain NaN 9798
7 407060 AltspaceVR NaN 14085
8 362620 Software Inc. NaN 39653
9 448300 Logic Missile NaN 766
10 448050 Mr. Nibbles Forever NaN 1121
11 401510 Lavapools NaN 468
12 396700 Hover Cubes: Arena NaN 306355
13 448020 Share 59.0 107630
14 456810 Zombillie NaN 107630
15 461970 Skyreach NaN 107630
16 447960 XCavalypse NaN 107630
17 399600 I and Me 93.0 938356
18 463050 The Pit And The Pendulum NaN 483
19 342150 Games of Glory NaN 136719
20 220200 Kerbal Space Program 88.0 63078
21 412310 Labyrinth 98.0 5205
22 416210 Block'hood NaN 92167
23 262590 Chucks Challenge 3D NaN 25415
24 407530 ARK: Survival Of The Fittest NaN 1449101
25 448110 So Long Earth NaN 483
26 427910 Zavix Tower NaN 25415
27 382850 Piercing Blow NaN 327636
28 325930 Viking Squad NaN 476297
29 398180 Euclidean 65.0 6583
... ... ... ... ...
221 400020 Atari Vault NaN 11636
222 385250 Paint it Back 84.0 3215
223 322780 Worlds Adrift NaN 693
224 404640 Game Tycoon 2 NaN 3215
225 428540 Fragments of Him NaN 442
226 432870 Special Tactics NaN 693
227 393380 Squad 68.0 476297
228 412450 The Black Death 42.0 7349
229 440 Team Fortress 2 92.0 32929431
230 463320 The Sea Eternal NaN 966
231 282660 EasyAntiCheat eSports NaN 252617
232 351100 Niffelheim NaN 252617
233 386080 Pharaonic NaN 483
234 423620 Hero Defense - Haunted Island NaN 8114
235 393430 Ice Lakes NaN 1121
236 443700 The Inner Sea NaN 1326
237 239490 America's Army: Proving Grounds Beta (Closed) NaN 173770
238 454150 Warbit 93.0 1990
239 444790 Abandoned Knight NaN 1415572
240 432980 INVERSUS NaN 1415572
241 276810 Mordheim: City of the Damned 74.0 112223
242 334230 Town of Salem NaN 220465
243 335950 Insecters War NaN 442
244 1930 Two Worlds: Epic Edition NaN 834860
245 299360 Block N Load 72.0 1322793
246 384960 Police Infinity NaN 693
247 365320 Quadrant NaN 919
248 233860 Kenshi NaN 116357
249 436410 Beyond The Destiny NaN 442
250 346900 AdVenture Capitalist NaN 3279730

251 rows × 4 columns


In [15]:
a.next.next


Out[15]:
': 69,004,323 ± 176,095'

In [ ]:


In [6]:
all_strong


Out[6]:
[<strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Free</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Metascore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Score rank:</strong>,
 <strong>Userscore:</strong>,
 <strong>Owners</strong>,
 <strong>Players in the last 2 weeks:</strong>,
 <strong>Players total:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 <strong>Owners</strong>,
 <strong>Developer:</strong>,
 <strong>Publisher:</strong>,
 <strong>Genre:</strong>,
 <strong>Release date</strong>,
 <strong>Price:</strong>,
 ...]

In [87]:
html = BeautifulSoup(webpage, 'html.parser')  ## beautifulsoup is a package for iterating over html structure

In [88]:
all_spans = html.find_all('span')  ### after exploring the structure of the html file, you can see that the score always
                                   ### comes within a <span> tag, when the class name include metascore_w
for span in all_spans:
    if span.get('class') is not None and 'metascore_w' in span.get('class'):
        print (span)
        score = span.text
        print (score)
        break

In [89]:
print (score, type (score))    ### score is your desired score for the game
print (int(score))


82 <class 'str'>
82

In [ ]: