#输出所得标签的 ' property value
Gets the content value of the first meta inside the head
soup.head.meta[' content ']
Get the contents of the first span
Soup.span.string
Get the contents of the first span
Soup.span.text
The Name property is called keywords all objects
Soup.find_all (attrs={' name ': ' keywords ')
Get style site_name All tags
Soup.find_all (class_= ' site_name ')
Soup.find (attrs={' name ': ' keywords ') gets the first property name the name value is the label of the keywords
Soup.find (' meta ', attrs={' name ': ' keywords '}) gets the first meta tag the Name property is the keywords label
Print (Soup.find (' meta ', attrs={' name ': ' keywords ') [' content ']) gets the first META tag Name property value is keywords content value
Print (Soup.find (' meta ', attrs={' name ': re.compile (' keywords ', re. IGNORECASE)}) gets the first meta tag the Name property value is a case-insensitive keywords label
BeautifulSoup Common methods