首頁  >  問答  >  主體

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了
然后通过代码,但是生成的文件内容乱七八糟。
用的火狐浏览器下载的源码

迷茫迷茫2740 天前541

全部回覆(0)我來回復

無回覆
  • 取消回覆