TypeError: can’t use a string pattern on a bytes-like object in re.findall() You want to convert html (a byte-like object) into a string using .decode, e.g. html = response.read().decode('utf-8'). See Convert bytes to a Python String