from mechanize import Browser browser = Browser() response = browser.open('http://www.google.com') print response.code