TypeError: cannot use a string pattern on a bytes-like object

You want to convert html (a byte-like object) into a string using .decode

html = response.read().decode('utf-8')

参考:https://stackoverflow.com/questions/31019854/typeerror-cant-use-a-string-pattern-on-a-bytes-like-object-in-re-findall

猜你喜欢

转载自blog.csdn.net/qq_39362996/article/details/88218548
今日推荐