“TypeError:
” TypeError: Cannot use a string pattern on a Byte-like object “
But a byte, so need to be matched in regular match object decoding will
links=re.findall('<loc>(.*?)</loc>',sitemap)
to
links=re.findall('<loc>(.*?)</loc>',sitemap.decode('utf-8'))
Similar Posts:
- Error reporting and resolution of Python 3 using binascii method
- [Solved] Typeerror: incorrect padding occurred in python3 Base64 decoding
- TypeError: strptime() argument 1 must be str, not bytes
- Perl : Quantifier follows nothing in regex; marked by
- IDEA compile error: sun.misc.Base64decoder upgrade processing
- [LeetCode] 291. Word Pattern II
- How to Solve Error: buuctf re [MRCTF2020]Xor
- [Solved] Python error: UnicodeDecodeError:’gbk’ codec can’t decode byte 0xb0 in position 166: illegal multibyte sequence
- python3 can’t concat str to bytes
- [Solved] error: cannot lock ref ‘refs/remotes/origin/[branch]’