![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python学习手册
丨养猪大户丨
兔子拼命跑,乌龟怎么办
展开
-
Python爬取网页title
from urllib.request import urlopenfrom urllib.error import HTTPError,URLErrorfrom bs4 import BeautifulSoup引入BeautifulSoup下面是getTitle函数def getTitle(url): try: html=urlopen(url)原创 2018-01-24 10:42:41 · 10204 阅读 · 0 评论 -
BS4中,find,fandAll两个函数的参数及其含义
findAll(tag,attributes,recursive,text,limit,keywords)tag:索要筛选的标签attributes:标签的特征值,是用Python字典封装的一个标签的若干属性和对应的属性值recursive:布尔型变量,是否递归,默认为Truetext:文本参数,用标签的文本内容去匹配#找到所有的含有the prince的标签namelist=原创 2018-01-24 11:24:39 · 4157 阅读 · 0 评论