replace空格无效后,提示解码出错是什么原因,replace空格,driver.impli


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

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

编橙之家文章,

评论关闭