Beautiful Soup 是用Python写的一个HTML/XML的解析器,它可以很好的处理不规范标记并生成剖析树(parse tree)。 
它提供简单又常用的导航(navigating),搜索以及修改剖析树的操作。它可以大大节省你的编程时间。


一、使用pip直接安装beautifulsoup4 


F:\>pip install beautifulsoup4


Collecting Beautifulsoup4
  Downloading beautifulsoup4-4.4.1-py3-none-any.whl (81kB)
    50% |████████████████                | 40kB 33kB/s eta 0:00:
    62% |████████████████████▏           | 51kB 32kB/s eta
    75% |████████████████████████▏       | 61kB 39kB/s
    88% |████████████████████████████▏   | 71kB 21k
    100% |████████████████████████████████| 81kB
 25kB/s
Installing collected packages: Beautifulsoup4
Successfully installed Beautifulsoup4-4.4.1

二 代理安装
  1. C:\>cd Python36

  2. C:\Python36>pip3 install -i http://mirrors.aliyun.com/pypi/simple/ beautifulsoup4 --truste
  3. d-host mirrors.aliyun.com
  4. Collecting beautifulsoup4
  5.   Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broke
  6. n by 'ConnectTimeoutError(
  7.  object at 0x03B60B30>, 'Connection to mirrors.aliyun.com timed out. (connect timeout=15)'
  8. )': /pypi/simple/beautifulsoup4/
  9.   Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broke
  10. n by 'ConnectTimeoutError(
  11.  object at 0x03B61590>, 'Connection to mirrors.aliyun.com timed out. (connect timeout=15)'
  12. )': /pypi/simple/beautifulsoup4/
  13.   Downloading http://mirrors.aliyun.com/pypi/packages/9e/d4/10f46e5cfac773e22707237bfcd51b
  14. bffeaf0a576b0a847ec7ab15bd7ace/beautifulsoup4-4.6.0-py3-none-any.whl (86kB)
  15.     70% |██████████████████████▋ | 61kB 3.2kB/s eta 0:00:08
  16.     82% |██████████████████████████▍ | 71kB 3.2kB/s eta 0:0
  17.     94% |██████████████████████████████▏ | 81kB 3.3kB/s eta
  18.     100% |████████████████████████████████| 92kB 3.7kB/s
  19. Installing collected packages: beautifulsoup4
  20. Successfully installed beautifulsoup4-4.6.0
三 下载安装
或者从官网下载Beautifulsoup的软件包,然后解压,cmd命令行进入解压包目录,输入以下命令安装:python setup.py install
记得在Python3里一定要安装beautifulsoup4的版本,其它版本安装不上的。

09-23 09:47
查看更多