BEAUTIFULSOUP4 description, which is an HTML parser, the use of the following description:
Soup = BeautifulSoup (Html_doc)
Print Soup.title//Get an element
Print Soup.title.name//Get a property of an element
Print soup.title.string//Gets the same text as the Soup.title.get_text () function under an element
Print SOUP.P
Print Soup.a
Print Soup.find_all (' a ')//Find all specified elements based on element name or attribute value
Print Soup.find (id= ' link3 ')//find the first matching element based on the element name or attribute value
Print Soup.get_text ()//Gets the text under an element
6.feedparser using the description, it can parse a URL seed, and the content of the dictionary to be categorized, and the object, using the following information:
Import Feedparser
Llog = Feedparser.parse ("Http://languagelog.ldc.upenn.edu/nll/?feed=atom")
llog[' feed ' [' title '] Gets the title of the seed, which is equivalent to Llog.feed.title
BEAUTIFULSOUP4 description, which is an HTML parser, the use of the following description: