Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Attributes | Properties | List of all members
bs4.element.PageElement Class Reference
Inheritance diagram for bs4.element.PageElement:
Inheritance graph
[legend]
Collaboration diagram for bs4.element.PageElement:
Collaboration graph
[legend]

Public Member Functions

None setup (self, Optional[Tag] parent=None, _AtMostOneElement previous_element=None, _AtMostOneElement next_element=None, _AtMostOneElement previous_sibling=None, _AtMostOneElement next_sibling=None)
 
str format_string (self, str s, Optional[_FormatterOrName] formatter)
 
Formatter formatter_for_name (self, Union[_FormatterOrName, _EntitySubstitutionFunction] formatter_name)
 
Self __deepcopy__ (self, Dict[Any, Any] memo, bool recursive=False)
 
Self __copy__ (self)
 
Iterator[str] stripped_strings (self)
 
str get_text (self, str separator="", bool strip=False, Iterable[Type[NavigableString]] types=default)
 
Self replace_with (self, *_InsertableElement args)
 
Tag wrap (self, Tag wrap_inside)
 
Self extract (self, Optional[int] _self_index=None)
 
None decompose (self)
 
List[PageElementinsert_before (self, *_InsertableElement args)
 
List[PageElementinsert_after (self, *_InsertableElement args)
 
_AtMostOneTag find_next (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, **_StrainableAttribute kwargs)
 
_AtMostOneNavigableString find_next (self, None name=None, None attrs=None, _StrainableString string="", **_StrainableAttribute kwargs)
 
Union[_AtMostOneTag, _AtMostOneNavigableString, _AtMostOneElement] find_next (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, **_StrainableAttribute kwargs)
 
_SomeTags find_all_next (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_SomeNavigableStrings find_all_next (self, None name=None, None attrs=None, _StrainableString string="", Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
Union[_SomeTags, _SomeNavigableStrings, _QueryResults] find_all_next (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_AtMostOneTag find_next_sibling (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, **_StrainableAttribute kwargs)
 
_AtMostOneNavigableString find_next_sibling (self, None name=None, None attrs=None, _StrainableString string="", **_StrainableAttribute kwargs)
 
Union[_AtMostOneTag, _AtMostOneNavigableString, _AtMostOneElement] find_next_sibling (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, **_StrainableAttribute kwargs)
 
_SomeTags find_next_siblings (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_SomeNavigableStrings find_next_siblings (self, None name=None, None attrs=None, _StrainableString string="", Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
Union[_SomeTags, _SomeNavigableStrings, _QueryResults] find_next_siblings (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_AtMostOneTag find_previous (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, **_StrainableAttribute kwargs)
 
_AtMostOneNavigableString find_previous (self, None name=None, None attrs=None, _StrainableString string="", **_StrainableAttribute kwargs)
 
Union[_AtMostOneTag, _AtMostOneNavigableString, _AtMostOneElement] find_previous (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, **_StrainableAttribute kwargs)
 
_SomeTags find_all_previous (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_SomeNavigableStrings find_all_previous (self, None name=None, None attrs=None, _StrainableString string="", Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
Union[_SomeTags, _SomeNavigableStrings, _QueryResults] find_all_previous (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_AtMostOneTag find_previous_sibling (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, **_StrainableAttribute kwargs)
 
_AtMostOneNavigableString find_previous_sibling (self, None name=None, None attrs=None, _StrainableString string="", **_StrainableAttribute kwargs)
 
Union[_AtMostOneTag, _AtMostOneNavigableString, _AtMostOneElement] find_previous_sibling (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, **_StrainableAttribute kwargs)
 
_SomeTags find_previous_siblings (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, None string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_SomeNavigableStrings find_previous_siblings (self, None name=None, None attrs=None, _StrainableString string="", Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
Union[_SomeTags, _SomeNavigableStrings, _QueryResults] find_previous_siblings (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[_StrainableString] string=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_AtMostOneTag find_parent (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, **_StrainableAttribute kwargs)
 
_SomeTags find_parents (self, _FindMethodName name=None, Optional[_StrainableAttributes] attrs=None, Optional[int] limit=None, int _stacklevel=2, **_StrainableAttribute kwargs)
 
_AtMostOneElement next (self)
 
_AtMostOneElement previous (self)
 
Iterator[PageElementnext_elements (self)
 
Iterator[PageElementself_and_next_elements (self)
 
Iterator[PageElementnext_siblings (self)
 
Iterator[PageElementself_and_next_siblings (self)
 
Iterator[PageElementprevious_elements (self)
 
Iterator[PageElementself_and_previous_elements (self)
 
Iterator[PageElementprevious_siblings (self)
 
Iterator[PageElementself_and_previous_siblings (self)
 
Iterator[Tagparents (self)
 
Iterator[PageElementself_and_parents (self)
 
bool decomposed (self)
 
Iterator[PageElementnextGenerator (self)
 
Iterator[PageElementnextSiblingGenerator (self)
 
Iterator[PageElementpreviousGenerator (self)
 
Iterator[PageElementpreviousSiblingGenerator (self)
 
Iterator[PageElementparentGenerator (self)
 

Public Attributes

 parent
 
 previous_element
 
 next_element
 
 next_sibling
 
 previous_sibling
 
 find_all_next
 
 next_elements
 
 find_next_siblings
 
 next_siblings
 
 find_all_previous
 
 previous_elements
 
 find_previous_siblings
 
 previous_siblings
 
 parents
 

Static Public Attributes

Optional known_xml = None
 
Optional parent [Tag]
 
_AtMostOneElement next_element
 
_AtMostOneElement previous_element
 
_AtMostOneElement next_sibling
 
_AtMostOneElement previous_sibling
 
bool hidden = False
 
 nextSibling = _deprecated_alias("nextSibling", "next_sibling", "4.0.0")
 
 previousSibling = _deprecated_alias("previousSibling", "previous_sibling", "4.0.0")
 
Iterable default = tuple()
 
str getText = get_text
 
 replaceWith = _deprecated_function_alias("replaceWith", "replace_with", "4.0.0")
 
 findNext = _deprecated_function_alias("findNext", "find_next", "4.0.0")
 
 findAllNext = _deprecated_function_alias("findAllNext", "find_all_next", "4.0.0")
 
 findNextSibling
 
 findNextSiblings
 
 fetchNextSiblings
 
 findPrevious = _deprecated_function_alias("findPrevious", "find_previous", "3.0.0")
 
 findAllPrevious
 
 fetchAllPrevious
 
 findPreviousSibling
 
 findPreviousSiblings
 
 fetchPreviousSiblings
 
 findParent = _deprecated_function_alias("findParent", "find_parent", "4.0.0")
 
 findParents = _deprecated_function_alias("findParents", "find_parents", "4.0.0")
 
 fetchParents = _deprecated_function_alias("fetchParents", "find_parents", "3.0.0")
 

Protected Member Functions

bool _is_xml (self)
 
Iterator[str] _all_strings (self, bool strip=False, Iterable[type[NavigableString]] types=default)
 
_AtMostOneElement _last_descendant (self, bool is_initialized=True, bool accept_self=True)
 
_AtMostOneElement _find_one (self, Callable method, _FindMethodName name, Optional[_StrainableAttributes] attrs, Optional[_StrainableString] string, **_StrainableAttribute kwargs)
 
_QueryResults _find_all (self, _FindMethodName name, Optional[_StrainableAttributes] attrs, Optional[_StrainableString] string, Optional[int] limit, Iterator[PageElement] generator, int _stacklevel=3, **_StrainableAttribute kwargs)
 
Iterator[PageElement_self_and (self, Iterator[PageElement] other_generator)
 

Static Protected Attributes

bool _decomposed
 
 _lastRecursiveChild
 

Properties

 text = property(get_text)
 

Detailed Description

An abstract class representing a single element in the parse tree.

`NavigableString`, `Tag`, etc. are all subclasses of
`PageElement`. For this reason you'll see a lot of methods that
return `PageElement`, but you'll never see an actual `PageElement`
object. For the most part you can think of `PageElement` as
meaning "a `Tag` or a `NavigableString`."

Member Function Documentation

◆ __copy__()

Self bs4.element.PageElement.__copy__ (   self)
A copy of a PageElement can only be a deep copy, because
only one PageElement can occupy a given place in a parse tree.

◆ __deepcopy__()

Self bs4.element.PageElement.__deepcopy__ (   self,
Dict[Any, Any]  memo,
bool   recursive = False 
)

◆ _all_strings()

Iterator[str] bs4.element.PageElement._all_strings (   self,
bool   strip = False,
Iterable[type[NavigableString]]   types = default 
)
protected
Yield all strings of certain classes, possibly stripping them.

This is implemented differently in `Tag` and `NavigableString`.

Reimplemented in bs4.element.NavigableString, and bs4.element.Tag.

◆ _find_all()

_QueryResults bs4.element.PageElement._find_all (   self,
_FindMethodName  name,
Optional[_StrainableAttributes]  attrs,
Optional[_StrainableString]  string,
Optional[int]  limit,
Iterator[PageElement generator,
int   _stacklevel = 3,
**_StrainableAttribute  kwargs 
)
protected
Iterates over a generator looking for things that match.

◆ _is_xml()

bool bs4.element.PageElement._is_xml (   self)
protected
Is this element part of an XML tree or an HTML tree?

This is used in formatter_for_name, when deciding whether an
XMLFormatter or HTMLFormatter is more appropriate. It can be
inefficient, but it should be called very rarely.

◆ _last_descendant()

_AtMostOneElement bs4.element.PageElement._last_descendant (   self,
bool   is_initialized = True,
bool   accept_self = True 
)
protected
Finds the last element beneath this object to be parsed.

Special note to help you figure things out if your type
checking is tripped up by the fact that this method returns
_AtMostOneElement instead of PageElement: the only time
this method returns None is if `accept_self` is False and the
`PageElement` has no children--either it's a NavigableString
or an empty Tag.

:param is_initialized: Has `PageElement.setup` been called on
    this `PageElement` yet?

:param accept_self: Is ``self`` an acceptable answer to the
    question?

◆ _self_and()

Iterator[PageElement] bs4.element.PageElement._self_and (   self,
Iterator[PageElement other_generator 
)
protected
Modify a generator by yielding this element, then everything
yielded by the other generator.

◆ decompose()

None bs4.element.PageElement.decompose (   self)
Recursively destroys this `PageElement` and its children.

The element will be removed from the tree and wiped out; so
will everything beneath it.

The behavior of a decomposed `PageElement` is undefined and you
should never use one for anything, but if you need to *check*
whether an element has been decomposed, you can use the
`PageElement.decomposed` property.

◆ decomposed()

bool bs4.element.PageElement.decomposed (   self)
Check whether a PageElement has been decomposed.

◆ extract()

Self bs4.element.PageElement.extract (   self,
Optional[int]   _self_index = None 
)
Destructively rips this element out of the tree.

:param _self_index: The location of this element in its parent's
   .contents, if known. Passing this in allows for a performance
   optimization.

:return: this `PageElement`, no longer part of the tree.

◆ find_all_next()

Union[_SomeTags,_SomeNavigableStrings,_QueryResults] bs4.element.PageElement.find_all_next (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
Optional[int]   limit = None,
int   _stacklevel = 2,
**_StrainableAttribute  kwargs 
)
Find all `PageElement` objects that match the given criteria and
appear later in the document than this `PageElement`.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a NavigableString with specific text.
:param limit: Stop looking after finding this many results.
:param _stacklevel: Used internally to improve warning messages.
:kwargs: Additional filters on attribute values.

◆ find_all_previous()

Union[_SomeTags,_SomeNavigableStrings,_QueryResults] bs4.element.PageElement.find_all_previous (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
Optional[int]   limit = None,
int   _stacklevel = 2,
**_StrainableAttribute  kwargs 
)
Look backwards in the document from this `PageElement` and find all
`PageElement` that match the given criteria.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a `NavigableString` with specific text.
:param limit: Stop looking after finding this many results.
:param _stacklevel: Used internally to improve warning messages.
:kwargs: Additional filters on attribute values.

◆ find_next()

Union[_AtMostOneTag,_AtMostOneNavigableString,_AtMostOneElement] bs4.element.PageElement.find_next (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
**_StrainableAttribute  kwargs 
)
Find the first PageElement that matches the given criteria and
appears later in the document than this PageElement.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a NavigableString with specific text.
:kwargs: Additional filters on attribute values.

◆ find_next_sibling()

Union[_AtMostOneTag,_AtMostOneNavigableString,_AtMostOneElement] bs4.element.PageElement.find_next_sibling (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
**_StrainableAttribute  kwargs 
)
Find the closest sibling to this PageElement that matches the
given criteria and appears later in the document.

All find_* methods take a common set of arguments. See the
online documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a `NavigableString` with specific text.
:kwargs: Additional filters on attribute values.

◆ find_next_siblings()

Union[_SomeTags,_SomeNavigableStrings,_QueryResults] bs4.element.PageElement.find_next_siblings (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
Optional[int]   limit = None,
int   _stacklevel = 2,
**_StrainableAttribute  kwargs 
)
Find all siblings of this `PageElement` that match the given criteria
and appear later in the document.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a `NavigableString` with specific text.
:param limit: Stop looking after finding this many results.
:param _stacklevel: Used internally to improve warning messages.
:kwargs: Additional filters on attribute values.

◆ find_parent()

_AtMostOneTag bs4.element.PageElement.find_parent (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
**_StrainableAttribute  kwargs 
)
Find the closest parent of this PageElement that matches the given
criteria.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param self: Whether the PageElement itself should be considered
   as one of its 'parents'.
:kwargs: Additional filters on attribute values.

◆ find_parents()

_SomeTags bs4.element.PageElement.find_parents (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[int]   limit = None,
int   _stacklevel = 2,
**_StrainableAttribute  kwargs 
)
Find all parents of this `PageElement` that match the given criteria.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param limit: Stop looking after finding this many results.
:param _stacklevel: Used internally to improve warning messages.
:kwargs: Additional filters on attribute values.

◆ find_previous()

Union[_AtMostOneTag,_AtMostOneNavigableString,_AtMostOneElement] bs4.element.PageElement.find_previous (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
**_StrainableAttribute  kwargs 
)
Look backwards in the document from this `PageElement` and find the
first `PageElement` that matches the given criteria.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a `NavigableString` with specific text.
:kwargs: Additional filters on attribute values.

◆ find_previous_sibling()

Union[_AtMostOneTag,_AtMostOneNavigableString,_AtMostOneElement] bs4.element.PageElement.find_previous_sibling (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
**_StrainableAttribute  kwargs 
)
Returns the closest sibling to this `PageElement` that matches the
given criteria and appears earlier in the document.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a `NavigableString` with specific text.
:kwargs: Additional filters on attribute values.

◆ find_previous_siblings()

Union[_SomeTags,_SomeNavigableStrings,_QueryResults] bs4.element.PageElement.find_previous_siblings (   self,
_FindMethodName   name = None,
Optional[_StrainableAttributes]   attrs = None,
Optional[_StrainableString]   string = None,
Optional[int]   limit = None,
int   _stacklevel = 2,
**_StrainableAttribute  kwargs 
)
Returns all siblings to this PageElement that match the
given criteria and appear earlier in the document.

All find_* methods take a common set of arguments. See the online
documentation for detailed explanations.

:param name: A filter on tag name.
:param attrs: Additional filters on attribute values.
:param string: A filter for a NavigableString with specific text.
:param limit: Stop looking after finding this many results.
:param _stacklevel: Used internally to improve warning messages.
:kwargs: Additional filters on attribute values.

◆ format_string()

str bs4.element.PageElement.format_string (   self,
str  s,
Optional[_FormatterOrName]  formatter 
)
Format the given string using the given formatter.

:param s: A string.
:param formatter: A Formatter object, or a string naming one of the standard formatters.

◆ formatter_for_name()

Formatter bs4.element.PageElement.formatter_for_name (   self,
Union[_FormatterOrName, _EntitySubstitutionFunction]   formatter_name 
)
Look up or create a Formatter for the given identifier,
if necessary.

:param formatter: Can be a `Formatter` object (used as-is), a
    function (used as the entity substitution hook for an
    `bs4.formatter.XMLFormatter` or
    `bs4.formatter.HTMLFormatter`), or a string (used to look
    up an `bs4.formatter.XMLFormatter` or
    `bs4.formatter.HTMLFormatter` in the appropriate registry.

◆ get_text()

str bs4.element.PageElement.get_text (   self,
str   separator = "",
bool   strip = False,
Iterable[Type[NavigableString]]   types = default 
)
Get all child strings of this PageElement, concatenated using the
given separator.

:param separator: Strings will be concatenated using this separator.

:param strip: If True, strings will be stripped before being
    concatenated.

:param types: A tuple of NavigableString subclasses. Any
    strings of a subclass not found in this list will be
    ignored. Although there are exceptions, the default
    behavior in most cases is to consider only NavigableString
    and CData objects. That means no comments, processing
    instructions, etc.

:return: A string.

◆ insert_after()

List[PageElement] bs4.element.PageElement.insert_after (   self,
*_InsertableElement  args 
)
Makes the given element(s) the immediate successor of this one.

The elements will have the same `PageElement.parent` as this
one, and the given elements will occur immediately after this
one.

:param args: One or more PageElements.

:return The list of PageElements that were inserted.

Reimplemented in bs4.BeautifulSoup.

◆ insert_before()

List[PageElement] bs4.element.PageElement.insert_before (   self,
*_InsertableElement  args 
)
Makes the given element(s) the immediate predecessor of this one.

All the elements will have the same `PageElement.parent` as
this one, and the given elements will occur immediately before
this one.

:param args: One or more PageElements.

:return The list of PageElements that were inserted.

Reimplemented in bs4.BeautifulSoup.

◆ next()

_AtMostOneElement bs4.element.PageElement.next (   self)
The `PageElement`, if any, that was parsed just after this one.

◆ next_elements()

Iterator[PageElement] bs4.element.PageElement.next_elements (   self)
All PageElements that were parsed after this one.

◆ next_siblings()

Iterator[PageElement] bs4.element.PageElement.next_siblings (   self)
All PageElements that are siblings of this one but were parsed
later.

◆ parents()

Iterator[Tag] bs4.element.PageElement.parents (   self)
All elements that are parents of this PageElement.

:yield: A sequence of Tags, ending with a BeautifulSoup object.

◆ previous()

_AtMostOneElement bs4.element.PageElement.previous (   self)
The `PageElement`, if any, that was parsed just before this one.

◆ previous_elements()

Iterator[PageElement] bs4.element.PageElement.previous_elements (   self)
All PageElements that were parsed before this one.

:yield: A sequence of PageElements.

◆ previous_siblings()

Iterator[PageElement] bs4.element.PageElement.previous_siblings (   self)
All PageElements that are siblings of this one but were parsed
earlier.

:yield: A sequence of PageElements.

◆ replace_with()

Self bs4.element.PageElement.replace_with (   self,
*_InsertableElement  args 
)
Replace this `PageElement` with one or more other elements,
objects, keeping the rest of the tree the same.

:return: This `PageElement`, no longer part of the tree.

◆ self_and_next_elements()

Iterator[PageElement] bs4.element.PageElement.self_and_next_elements (   self)
This PageElement, then all PageElements that were parsed after it.

◆ self_and_next_siblings()

Iterator[PageElement] bs4.element.PageElement.self_and_next_siblings (   self)
This PageElement, then all of its siblings.

◆ self_and_parents()

Iterator[PageElement] bs4.element.PageElement.self_and_parents (   self)
This element, then all of its parents.

:yield: A sequence of PageElements, ending with a BeautifulSoup object.

◆ self_and_previous_elements()

Iterator[PageElement] bs4.element.PageElement.self_and_previous_elements (   self)
This PageElement, then all elements that were parsed
earlier.

◆ self_and_previous_siblings()

Iterator[PageElement] bs4.element.PageElement.self_and_previous_siblings (   self)
This PageElement, then all of its siblings that were parsed
earlier.

◆ setup()

None bs4.element.PageElement.setup (   self,
Optional[Tag]   parent = None,
_AtMostOneElement   previous_element = None,
_AtMostOneElement   next_element = None,
_AtMostOneElement   previous_sibling = None,
_AtMostOneElement   next_sibling = None 
)
Sets up the initial relations between this element and
other elements.

:param parent: The parent of this element.

:param previous_element: The element parsed immediately before
    this one.

:param next_element: The element parsed immediately after
    this one.

:param previous_sibling: The most recently encountered element
    on the same level of the parse tree as this one.

:param previous_sibling: The next element to be encountered
    on the same level of the parse tree as this one.

◆ stripped_strings()

Iterator[str] bs4.element.PageElement.stripped_strings (   self)
Yield all interesting strings in this PageElement, stripping them
first.

See `Tag` for information on which strings are considered
interesting in a given context.

◆ wrap()

Tag bs4.element.PageElement.wrap (   self,
Tag  wrap_inside 
)
Wrap this `PageElement` inside a `Tag`.

:return: ``wrap_inside``, occupying the position in the tree that used
   to be occupied by this object, and with this object now inside it.

Member Data Documentation

◆ _lastRecursiveChild

bs4.element.PageElement._lastRecursiveChild
staticprotected
Initial value:
= _deprecated_alias(
"_lastRecursiveChild", "_last_descendant", "4.0.0"
)

◆ fetchAllPrevious

bs4.element.PageElement.fetchAllPrevious
static
Initial value:
= _deprecated_function_alias(
"fetchAllPrevious", "find_all_previous", "3.0.0"
)

◆ fetchNextSiblings

bs4.element.PageElement.fetchNextSiblings
static
Initial value:
= _deprecated_function_alias(
"fetchNextSiblings", "find_next_siblings", "3.0.0"
)

◆ fetchPreviousSiblings

bs4.element.PageElement.fetchPreviousSiblings
static
Initial value:
= _deprecated_function_alias(
"fetchPreviousSiblings", "find_previous_siblings", "3.0.0"
)

◆ findAllPrevious

bs4.element.PageElement.findAllPrevious
static
Initial value:
= _deprecated_function_alias(
"findAllPrevious", "find_all_previous", "4.0.0"
)

◆ findNextSibling

bs4.element.PageElement.findNextSibling
static
Initial value:
= _deprecated_function_alias(
"findNextSibling", "find_next_sibling", "4.0.0"
)

◆ findNextSiblings

bs4.element.PageElement.findNextSiblings
static
Initial value:
= _deprecated_function_alias(
"findNextSiblings", "find_next_siblings", "4.0.0"
)

◆ findPreviousSibling

bs4.element.PageElement.findPreviousSibling
static
Initial value:
= _deprecated_function_alias(
"findPreviousSibling", "find_previous_sibling", "4.0.0"
)

◆ findPreviousSiblings

bs4.element.PageElement.findPreviousSiblings
static
Initial value:
= _deprecated_function_alias(
"findPreviousSiblings", "find_previous_siblings", "4.0.0"
)

The documentation for this class was generated from the following file: