Python 爬虫
文章发布时间:
最后更新时间:
最后更新时间:
基本
Python virtual environment (venv)
$ pip list
这将显示当前虚拟环境中安装的所有软件包及其版本号。
request库
1 | |
1 | |
r.content 是字节形式内容,text是编码后的内容(一般是Unicode编码)
1 | |
BeautifulSoup 和 lxml
bs1 = BeautifulSoup(ht.content, 'lxml')
lxml是xml和html的解析器
bs1.prettify(),用于美化HTML或XML文档的输出。
1 | |
bs1.find() and find_all() and select()
XPath
[[MongoDB]]
详见 https://cuiqingcai.com/202243.html
还有自己的程序