from:https://blog.csdn.net/xie_0723/article/details/50825310
Solution
1: filename = 'E: \ testresult.html', if a windows environment, the file name you want to use the following format.
①filename = E: \\ testresult.html '
②filename = r'E: \ testresult.html'
③filename = e: /testresult.html '
2: if it is done with the use of context management file, remember to fp.close()
close open files before they can be saved.
fp = open(filename, 'wb')
fp.close()
3. Run the command line
4. IF __name__ == '__main__': IF __name__ == 'interface_demo':
# the main modifications into their own folder name on it