如何查看输出HTML

时间:2013-04-10 13:43:18

标签: python mechanize

我在python中有这段代码:

resp = mechanize.Request(url, data)
cj.add_cookie_header(resp)
res1 = mechanize.urlopen(resp)

如何查看输出HTML?

1 个答案:

答案 0 :(得分:2)

只需打印您的回复:

resp = mechanize.Request(url, data)
cj.add_cookie_header(resp)
res1 = mechanize.urlopen(resp)
print res1.read()