Hubwiz.com
|
Online Course
|
API Manual
Beautiful Soup API Manual
Function(106)
Function
Beautiful Soup
Getting help
Quick Start
Installing Beautiful Soup
Problems after installation
Installing a parser
Making the soup
Kinds of objects
Tag
Name
Attributes
Multi-valued attributes
NavigableString
BeautifulSoup
Comments and other special strings
Navigating the tree
Going down
Navigating using tag names
.contents and .children
.descendants
.string
.strings and stripped_strings
Going up
.parent
.parents
Going sideways
.next_sibling and .previous_sibling
.next_siblings and .previous_siblings
Going back and forth
.next_element and .previous_element
.next_elements and .previous_elements
Searching the tree
Kinds of filters
A string
A regular expression
A list
True
A function
find_all()
The name argument
The keyword arguments
Searching by CSS class
The text argument
The limit argument
The recursive argument
Calling a tag is like calling find_all()
find()
find_parents() and find_parent()
find_next_siblings() and find_next_sibling()
find_previous_siblings() and find_previous_sibling()
find_all_next() and find_next()
find_all_previous() and find_previous()
CSS selectors
Modifying the tree
Changing tag names and attributes
Modifying .string
append()
BeautifulSoup.new_string() and .new_tag()
insert()
insert_before() and insert_after()
clear()
extract()
decompose()
replace_with()
wrap()
unwrap()
Output
Pretty-printing
Non-pretty printing
Output formatters
get_text()
Specifying the parser to use
Differences between parsers
Encodings
Output encoding
Unicode, Dammit
Smart quotes
Inconsistent encodings
Parsing only part of a document
SoupStrainer
Troubleshooting
diagnose()
Errors when parsing a document
Version mismatch problems
Parsing XML
Other parser problems
Miscellaneous
Improving Performance
Beautiful Soup 3
Porting code to BS4
You need a parser
Method names
Generators
XML
Entities
Miscellaneous
Parsing XML
limit
**kwargs
the valueTrue
Remember
.next_siblings
.next_elements
.stripped_strings
`
install lxml orhtml5lib.