FINDALL (tag, attributes, recursive, text, limit, keywords)
Find (tag, attributes, recursive, text, keywords)
Tag parameter tag: Pass the name of a label or multiple label names Python list to do label parameters
the attribute parameter attributes is used with a python A dictionary encapsulates several properties and corresponding property values for a label
The recursive parameter recursive is a Boolean variable. How many layers of information do you want to crawl in the HTML document tag structure? If recursive is set to True, FindAll will find all the child tags of the label parameters and sub-labels of the child tags according to your requirements. If recursive is set to False, FindAll only finds the first-level label of the document. FindAll default is to support recursive lookups (the recursive default value is True);
Text parameter the text is matched with the textual content of the label, not the attribute of the label
In the BeautifulSoup library, all child tags are descendant tags, but not all descendant tags are sub-tags. If you only want to find the sub-tags, you can use the. Children tag
BeautifulSoup's next_siblings () function can make it easy to collect tabular data.
When crawling Web pages, finding the parent tag is a lot less demanding than finding child tags and sibling tags. Usual situation
, if you are looking at HTML pages for the purpose of crawling Web content, we start with the top
Think about how to locate the block where we want the data to be located. However, occasionally in special cases you will also use
BeautifulSoup The parent tag lookup function, parent and parents.
This article from "Big Plum" blog, reproduced please contact the author!
Python network data acquisition first day