Which is best in Python: urllib2, PycURL or mechanize?

前端 未结 8 1389
一个人的身影
一个人的身影 2021-01-29 17:48

Ok so I need to download some web pages using Python and did a quick investigation of my options.

Included with Python:

urllib - seems to me that I should use ur

8条回答
  •  青春惊慌失措
    2021-01-29 18:03

    • urllib2 is found in every Python install everywhere, so is a good base upon which to start.
    • PycURL is useful for people already used to using libcurl, exposes more of the low-level details of HTTP, plus it gains any fixes or improvements applied to libcurl.
    • mechanize is used to persistently drive a connection much like a browser would.

    It's not a matter of one being better than the other, it's a matter of choosing the appropriate tool for the job.

提交回复
热议问题