- 帖子
- 15
- 精华
- 0
- 积分
- 98
- 阅读权限
- 20
- 注册时间
- 2017-11-30
- 最后登录
- 2022-1-5
|
不对哦,还是会报错的喔:
Traceback (most recent call last):
File "D:\Documents\notepad\webscrab.py", line 17, in <module>
f.write(html,encoding='utf-8')
TypeError: write() takes no keyword arguments
[Finished in 1.5s with exit code 1]
[shell_cmd: python -u "D:\Documents\notepad\webscrab.py"]
[dir: D:\Documents\notepad]
[path: C:;D:\JAVA\bin;D:\JAVA\jre\bin;\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;c:\Program Files\Intel\WiFi\bin\;c:\Program Files\Common Files\Intel\WirelessCommon\;D:\matlab 2015b\runtime\win64;D:\matlab 2015b\bin;D:\matlab 2015b\polyspace\bin;D:\Python36\Scripts\;D:\Python36\;D:\VC6.0\Tools\WinNT;D:\VC6.0\MSDev98\Bin;D:\VC6.0\Tools;D:\VC98\bin;D:\Fiddler;]
改成这样就对了:
with open('/html_bd.txt','a',encoding='utf-8') as f:
f.write(html)
嘻嘻!
|
|