def item_id(id_var):

#id_var = input('Please Enter item_ID: ')

f = urllib.request.urlopen('http://services.runescape.com/m=itemdb_oldschool/viewitem?obj='+ str(id_var))

#Decodes utf-8

html = f.read().decode('utf-8')

#Uses '

' for each line of an html page to create a list using split.

words = html.split("

")

#checks to see if page/item exists

print(words[61])

#DO NOT REMOVE THE FUCKING SPACES, YOU'LL FUCK IT UP

if words[61] != " <div class='content error'>":

print_debug(words[68])

#create pointer for an array

html_str = words[68]

#split the characters in the individual string.

split_2 = html_str.split("\t")

print(split_2[:])

#create pointer to array

split_3 = split_2[5]

#get rid of junk, have only integers

s = ''.join(x for x in split_3 if x.isdigit())

print(split_2[5])

print("Item price is: " + s)

item_name = get_name(words[7])

print("The item name is: " + item_name)

return [item_name, s]

else:

item_name = "null"

s = 0

return[item_name, s]

#UPDATES THE DATABASE

def update_ge_db(min, max):

new_list = [ ]

#item_number=1778

for item_number in range(min,max):

item_A = item_id(item_number)

T = Items(id=item_number,item_name=item_A[0],item_price=item_A[1],item_ge_id=int(item_number))

T.save()

new_list.append(item_A)