Stack Exchange
python mechanize import failing with python 2.x
Mechanize is not working with python 2.x while using "Browser" in mechanize failing.
import re
from mechanize import Browser

br = mechanize.Browser()
br.open("https://en.wikipedia.org/wiki/Whey_protein")

response1 = br.follow_link(text_regex=r"protein\s*shop", nr=1)
assert br.viewing_html()
print(br.title())
print(response1.geturl())
print(response1.info())
print(response1.read()) )


Traceback (most recent call last):
File "C:\Users\test\Mechnize_bt.py", line 2, in 
from mechanize import Browser
ImportError: cannot import name Browser


please post the full traceback

Do you have a local file named mechanize.py in the same folder as your script?
