python
shadowgully
这个作者很懒,什么都没留下…
展开
-
beautifulsoup4安装
BeautifulSoup4安装 使用如下命令安装: pip install beautifulsoup4 导入beautifulsoup: from bs4 import BeautifulSoup #注意大小写 在pycharm中可能会出现无法导入bs4的问题,可能是因为pycharm默认使用了工作空间的虚拟环境 需要将其改为python安装目录下的启动器 改为python安装目录下...原创 2019-07-19 14:02:14 · 1121 阅读 · 0 评论 -
beautifulsoup的使用
beautifulsoup的使用 直接提取html代码 使用urlopen获取html from urllib.request import urlopen html=urlopen("https://docs.python.org/3/tutorial/index.html") print(html.read()) 将输出该页面的完整html代码 按标签结构提取 将html代码传递到Beauti...原创 2019-07-19 17:05:38 · 145 阅读 · 0 评论