是否有我们可以下载的用于 python 的 urllib2 库? [英] Is there a library for urllib2 for python which we can download?

查看:33
本文介绍了是否有我们可以下载的用于 python 的 urllib2 库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 BeautifulSoup 中使用 urllib2.我找到了 BeautifulSoup 的下载文件并安装了它,但是我找不到 urllib2 的任何下载文件,还有其他方法可以安装该模块吗?

I need to use urllib2 with BeautifulSoup. I found the download file for BeautifulSoup and installed it, however, I couldn't find any download files for urllib2, is there another way to intall that module?

推荐答案

Python自带的模块,直接导入即可:

The module comes with Python, simply import it:

import urllib2

如果您使用的是 Python3,urllib 将替换为 urllib.请求.Urllib PEP (Python3):http://www.python.org/dev/peps/pep-3108/#urllib-package.

If you're using Python3, the urllib was replaced by urllib.request. The Urllib PEP (Python3): http://www.python.org/dev/peps/pep-3108/#urllib-package.

这篇关于是否有我们可以下载的用于 python 的 urllib2 库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆