which function of mechanize is equal with urllib.urlencode
urllib.urlencode could encode url's params开发者_高级运维. It seems no likely function in Mechanize.
So, I have to use urllib and Mechanize, because I only need urlencode.
Any function could implement the same task like urllib.urlencode in Mechanize
Why would mechanize
have it? It's already in urllib
, which comes with Python.
mechanize
actually uses urllib
and urllib2
for most tasks that involve urls.
Since this functionality already exists in urllib/2
(as mentioned by Ignacio Vazquez-Abrams) there's no need for it to be implemented elsewhere. When coding you import all the libraries that have functionality you need to use.
精彩评论