I was watching a tutorial on web paring in python .
import re
import urllib.request
# http://ift.tt/TcXbw1
url = "http://ift.tt/TcXbw1"
stock = input("Enter Your Stock : ")
url = url + stock
data = urllib.request.urlopen(url).read()
newData = data.decode('utf-8')
# meta itemprop="price"
m = re.search('meta itemprop="price"', newData)
start = m.start()
end = start + 50
newStock = newData[start:end]
m = re.search('content="', newStock)
start = m.end()
newStock1 = newStock[start:]
m = re.search('/', newStock1)
start = 0
end = m.end() - 3
final = newStock1[0:end]
print("The Value Of " + stock + " Is " + final)
There is no error but I dont understand these parts :
start = m.start()
end = start + 50
start = 0
end = m.end() - 3
Can anyone give me an explanation ? Please elaborate
Aucun commentaire:
Enregistrer un commentaire