ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control character
在网页爬虫时,当出现上述问题,原因是一些控制字符(unicode)的问题,因此需要删除控制字符,如下:
def remove_control_characters(html):
def str_to_int(s, default, base=10):
if int(s, base) < 0x10000:
return chr(int(s, ...
原创
2019-09-09 14:08:46 ·
3434 阅读 ·
0 评论