I found a python2 project on GitHub, and wanted to transalte it into python3. I just wondered if requests and mechanize are basically the same, and can be replaced with each other.
Asked
Active
Viewed 1,188 times
4
-
Possible duplicate of http://stackoverflow.com/questions/13209778/whats-the-easiest-way-to-get-mechanize-for-python-3-on-debian – Seth Difley Aug 15 '14 at 01:12
-
@SethDifley ,I tried installing that, but it didn't work. – Tsumugi Kotobuki Aug 15 '14 at 01:18
-
@SethDifley This didn't seem to work for anyone. – Tsumugi Kotobuki Aug 15 '14 at 01:22
1 Answers
3
No. While they have some of the same features they are definitely not the same. Mechanize appears to have more features than requests. Mechanize has the ability to "solve" forms on a page where Requests is more for just pulling the raw HTML of a page or interacting with a web API. For requests to gain this functionality requires another library. You could replace Mehchanize with MechanicalSoup. In fact the creator started MechanicalSoup because Mechanize isn't ported to 3.* yet.
I was a fond user of the Mechanize library, but unfortunately it's incompatible with Python 3 and development is inactive. MechanicalSoup provides a similar API, built on Python giants Requests (for http sessions) and BeautifulSoup (for document navigation).

Sleep Deprived Bulbasaur
- 2,368
- 4
- 21
- 33
-
Deprivaded Bulbas ,so MechanicalSoup is mechanize, but just in python3? – Tsumugi Kotobuki Aug 15 '14 at 01:27
-