python提示解码出错

driver.implicitly_wait(3)
html=driver.page_source
f=open("D://auto.txt",'a')
html.replace(u'\xa0','ignore')
content=html.encode('gbk','ignore')
html=content.decode('gbk')
f.write(html)

replace空格,莫名其妙的不能生效,我也不知道为什么,最后只好ignore了
然后通过代码,但是生成的文件内容乱七八糟。
用的火狐浏览器下载的源码

阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题