Installing from Github
To install from github we need to clone the repo into our system. To clone the repo and then install it type the below command in the terminal.
git clone https://github.com/python-mechanize/mechanize.git cd mechanize pip3 install -e
Example
mechanize exports the complete interface using mechanize.urlopen() methods.
Python3
# import module import mechanize # read url with urlopen() response = mechanize.urlopen( "http://www.w3wiki.org/" ) print (response.read()) |
Output:
How to Install mechanize for Python?
In this article, we are going to install mechanize for Python. Mechanize was designed by John J. Lee. and Maintenance take over by Kovid Goyal in 2017. It follows the Stateful programmatic web browsing in Python