UnicodeDecodeError: 'utf8' codec can't decode byte 0xb2 in position 0: invalid start byte

自动化脚本遇到了这个问题,访问的页面用的utf8,为什么不行呢?

decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串转换成unicode编码。

encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode('gb2312'),表示将unicode编码的字符串转换成gb2312编码。

print u"输入错误,已退出".decode('utf8').encode('mbcs')

 

 

火狐浏览器登录遇到下面的问题:

selenium.common.exceptions.ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with
Stacktrace

 

相关文章:

  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
猜你喜欢
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案