Hi All
When trying to open a URL with bellow code, it Gives "TypeError: not all arguments converted during string formatting"
import urllib
City="%D9%85%D9%87%D8%B1%D8%A7%D9%86"
Province="%D8%A7%DB%8C%D9%84%D8%A7%D9%85"
myurl = 'http://www.owghat.com/owghat.png.aspx?Province='+'%s'+'&City='+'%s'%(Province, City)
#the real address is:http://www.owghat.com/owghat.png.aspx?Province=%D8%A7%DB%8C%D9%84%D8%A7%D9%85&City=%D9%85%D9%87%D8%B1%D8%A7%D9%86
a="e:\\img.png"
urllib.urlretrieve(myurl,a)
So, what I'm doing wrong?
AND Another question: How to encode a utf-8 string(example: مهران) to something like "%D9%85%D9%87%D8%B1%D8%A7%D9%86" in a url?
Thanks in advance for any help.