What are the differences between the urllib, urllib2, urllib3 and requests module?

后端 未结 11 2310
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 04:19

In Python, what are the differences between the urllib, urllib2, urllib3 and requests modules? Why are there three? They seem to do the same thing...

11条回答
  •  被撕碎了的回忆
    2020-11-22 04:43

    I like the urllib.urlencode function, and it doesn't appear to exist in urllib2.

    >>> urllib.urlencode({'abc':'d f', 'def': '-!2'})
    'abc=d+f&def=-%212'
    

提交回复
热议问题