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

后端 未结 11 2284
隐瞒了意图╮
隐瞒了意图╮ 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:50

    You should generally use urllib2, since this makes things a bit easier at times by accepting Request objects and will also raise a URLException on protocol errors. With Google App Engine though, you can't use either. You have to use the URL Fetch API that Google provides in its sandboxed Python environment.

提交回复
热议问题