从机械化网站首页上的大例子中读取:
# Sometimes it's useful to process bad headers or bad HTML:response = br.response() # this is a copy of responseheaders = response.info() # currently, this is a mimetools.Messageheaders["Content-type"] = "text/html; charset=utf-8"response.set_data(response.get_data().replace("<!---", "<!--"))br.set_response(response)因此,似乎很有可能用另一个解析器预处理响应,该解析器将重新生成格式正确的HTML,然后将其反馈给机械化以进行进一步处理。



