I was working on a python script to automatically extract ratings from imdb, only I am unable to extract the numbers from my result.
from pattern.web import URL
from pattern.web import plaintext
from pattern.web import decode_utf8
import re
def scrape_imdb(film):
url = URL (film)
s=url.download()
decode_utf8(url.download(s))
regels=re.compile(('"ratingValue">[0-9].[0-9]'))
rating= regels.findall(s)
rating2= rating[0:1]
rating3= rating2.findall("[0-9"])
regels2=re.compile ("<title>.*</title>")
titel=regels2.findall(s)
print titel, rating2
But this gives me an error. Anyone know what I'm doing wrong?