Infi-chu:

http://www.cnblogs.com/Infi-chu/

Py2.x:

  Urllib库

  Urllin2库

Py3.x:

  Urllib库

变化:

  1. 在Pytho2.x中使用import urllib2——-对应的,在Python3.x中会使用import urllib.request,urllib.error。
  2. 在Pytho2.x中使用import urllib——-对应的,在Python3.x中会使用import urllib.request,urllib.error,urllib.parse。
  3. 在Pytho2.x中使用import urlparse——-对应的,在Python3.x中会使用import urllib.parse。
  4. 在Pytho2.x中使用import urlopen——-对应的,在Python3.x中会使用import urllib.request.urlopen。
  5. 在Pytho2.x中使用import urlencode——-对应的,在Python3.x中会使用import urllib.parse.urlencode。
  6. 在Pytho2.x中使用import urllib.quote——-对应的,在Python3.x中会使用import urllib.request.quote。
  7. 在Pytho2.x中使用cookielib.CookieJar——-对应的,在Python3.x中会使用http.CookieJar。
  8. 在Pytho2.x中使用urllib2.Request——-对应的,在Python3.x中会使用urllib.request.Request。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案