http://wwwsearch.sourceforge.net/mechanize/download.html
上面有下载链接及详细的安装方法,简单介绍下,一共有两种:
easy_install:先安装EasyInstall,然后在命令行执行
easy_install Mechanize
#coding=utf-8 import mechanize url = "http://www.baidu.com" request = mechanize.Request(url) response = mechanize.urlopen(request) xmlStr = response.read() print xmlStr当然,mechanize不仅仅是从网络上下数据而已,还可以模拟用户动作。如有好的建议请直接联系我。