import urllib.request
import sys
#'http://www.imdb.com/list/SuSZdwCyHzU/'
def savePage(urll,filename):
with urllib.request.urlopen(urll)as url:
page=url.read()
# print(page)
sys.argv[0]=filename
outfile=open(sys.argv[0],'w')
for line in page:
outfile.write(line)
outfile.close()
savePage('http://www.imdb.com/list/SuSZdwCyHzU/','outIMDB.txt')
so here is my code .I try to write the original codes into the 'outIMDB.text' but somehow I got this bug:
File "C:\Program Files (x86)\Wing IDE 101 4.0\src\debug\tserver\_sandbox.py", line 14, in <module>
File "C:\Program Files (x86)\Wing IDE 101 4.0\src\debug\tserver\_sandbox.py", line 11, in savePage
builtins.TypeError: must be str, not int
I appreciate it if someone can shed some light on that.