BEAUTIFULSOUP4 description, which is an HTML parser, the use of the following description:

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.