“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'))