i try to build a little script to read a webpage, read movie titles and query imdb.com.
Code: Alles auswählen
from urllib2 import urlopen
from lxml.html import parse
from lxml.etree import tostring
from lxml.html import HTMLParser
import socket
import re
import urllib
import os
# Read movie titles
parser = HTMLParser()
....
m.name=tableRow.find("td[@class='col-3']/span/strong/a").text
....
#Read Rating
title=urllib.urlencode({'q':m.name.encode('utf-8')})
But the "title" will Result in something like : q=Die+Land%C3%83%C2%A4rztin
A german "ä" is encoded as %C3%83%C2%A4r
but should be: %C3%A4
so what's going wrong?
Thanks a lot
Christian N.