赞
踩
root@xxxx:~# pip install bs4 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',))': /simple/bs4/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',))': /simple/bs4/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',))': /simple/bs4/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',))': /simple/bs4/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',))': /simple/bs4/ ERROR: Could not find a version that satisfies the requirement bs4 (from versions: none) ERROR: No matching distribution found for bs4
#Python2安装 apt-get install -y python-bs4 #Python3安装 apt-get install -y python3-bs4
html_doc = """ <html><head><title>The Dormouse's story</title></head> <body> <p class="title"><b>The Dormouse's story</b></p> <p class="story">Once upon a time there were three little sisters; and their names were <a href="http://example.com/elsie" class="sister" id="link1">Elsie</a>, <a href="http://example.com/lacie" class="sister" id="link2">Lacie</a> and <a href="http://example.com/tillie" class="sister" id="link3">Tillie</a>; and they lived at the bottom of a well.</p> <p class="story">...</p> """
from bs4 import BeautifulSoup soup = BeautifulSoup(html_doc, 'html.parser') print(soup.prettify())
apt-cache search package #搜索包 apt-cache show package #获取包的相关信息,如说明、大小、版本等 apt-get install package #安装包 apt-get install package --reinstall #重新安装包 apt-get -f install #强制安装 apt-get remove package #删除包 apt-get remove package - - purge #删除包,包括删除配置文件等 apt-get autoremove #自动删除不需要的包 apt-get update #更新源 apt-get upgrade #更新已安装的包 apt-get dist-upgrade #升级系统 apt-get dselect-upgrade #使用 dselect 升级 apt-cache depends package #了解使用依赖 apt-cache rdepends package #了解某个具体的依赖 apt-get build-dep package #安装相关的编译环境 apt-get source package #下载该包的源代码 apt-get clean && sudo apt-get autoclean #清理下载文件的存档 apt-get check #检查是否有损坏的依赖
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。