diff options
author | Leonard Richardson <leonardr@segfault.org> | 2019-12-24 17:08:36 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2019-12-24 17:08:36 -0500 |
commit | fc4a0e6c7a0bc9fc078400bc8310008b38a14e7a (patch) | |
tree | 9af1367cfcb41843d36f82b67861fc88d59531e9 /bs4/__init__.py | |
parent | 3ecda287c84bbc05637b199e266f7c309ffc1b13 (diff) |
Minor changes to docstrings.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r-- | bs4/__init__.py | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py index a8bdc8d..35bc4d3 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -1,6 +1,5 @@ -"""Beautiful Soup -Elixir and Tonic -"The Screen-Scraper's Friend" +"""Beautiful Soup Elixir and Tonic - "The Screen-Scraper's Friend". + http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a @@ -12,9 +11,7 @@ Beautiful Soup works with Python 2.7 and up. It works better if lxml and/or html5lib is installed. For more than you ever wanted to know about Beautiful Soup, see the -documentation: -http://www.crummy.com/software/BeautifulSoup/bs4/doc/ - +documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/ """ __author__ = "Leonard Richardson (leonardr@segfault.org)" @@ -105,12 +102,13 @@ class BeautifulSoup(Tag): :param markup: A string or a file-like object representing markup to be parsed. - :param features: Desirable features of the parser to be used. This - may be the name of a specific parser ("lxml", "lxml-xml", - "html.parser", or "html5lib") or it may be the type of markup - to be used ("html", "html5", "xml"). It's recommended that you - name a specific parser, so that Beautiful Soup gives you the - same results across platforms and virtual environments. + :param features: Desirable features of the parser to be + used. This may be the name of a specific parser ("lxml", + "lxml-xml", "html.parser", or "html5lib") or it may be the + type of markup to be used ("html", "html5", "xml"). It's + recommended that you name a specific parser, so that + Beautiful Soup gives you the same results across platforms + and virtual environments. :param builder: A TreeBuilder subclass to instantiate (or instance to use) instead of looking one up based on @@ -140,14 +138,15 @@ class BeautifulSoup(Tag): :param kwargs: For backwards compatibility purposes, the constructor accepts certain keyword arguments used in Beautiful Soup 3. None of these arguments do anything in - Beautiful Soup 4; they will result in a warning and then be ignored. + Beautiful Soup 4; they will result in a warning and then be + ignored. - Apart from this, any keyword arguments passed into the BeautifulSoup - constructor are propagated to the TreeBuilder constructor. This - makes it possible to configure a TreeBuilder by passing in arguments, - not just by saying which one to use. + Apart from this, any keyword arguments passed into the + BeautifulSoup constructor are propagated to the TreeBuilder + constructor. This makes it possible to configure a + TreeBuilder by passing in arguments, not just by saying which + one to use. """ - if 'convertEntities' in kwargs: del kwargs['convertEntities'] warnings.warn( @@ -342,9 +341,7 @@ class BeautifulSoup(Tag): self.builder.soup = None def __copy__(self): - """A copy of a BeautifulSoup object is created by converting the - document to a string and parsing it again. - """ + """Copy a BeautifulSoup object by converting the document to a string and parsing it again.""" copy = type(self)( self.encode('utf-8'), builder=self.builder, from_encoding='utf-8' ) |