class documentation

class InputElement(InputMixin, HtmlElement):

View In Hierarchy

Represents an <input> element.

You can get the type with .type (which is lower-cased and defaults to 'text').

Also you can get and set the value with .value

Checkboxes and radios have the attribute input.checkable == True (for all others it is false) and a boolean attribute .checked.

Method checked.setter Undocumented
Method type.setter Undocumented
Method value.deleter Undocumented
Method value.setter Undocumented
Property checkable Boolean: can this element be checked?
Property checked Boolean attribute to get/set the presence of the checked attribute.
Property type Return the type of this element (using the type attribute).
Property value Get/set the value of this element, using the value attribute.

Inherited from InputMixin:

Method __repr__ Undocumented
Method name.deleter Undocumented
Method name.setter Undocumented
Property name Get/set the name of the element

Inherited from HtmlMixin (via HtmlElement):

Method classes.setter Undocumented
Method cssselect Run the CSS expression on this element and its children, returning a list of the results.
Method drop​_tag Remove the tag, but not its children or text. The children and text are merged into the parent.
Method drop​_tree Removes this element from the tree, including its children and text. The tail text is joined to the previous element or parent.
Method find​_class Find any elements with the given class name.
Method find​_rel​_links Find any links like <a rel="{rel}">...</a>; returns a list of elements.
Method get​_element​_by​_id Get the first element in a document with the given id. If none is found, return the default argument if provided or raise KeyError otherwise.
Method iterlinks No summary
Method label.deleter Undocumented
Method label.setter Undocumented
Method make​_links​_absolute No summary
Method resolve​_base​_href Find any <base href> tag in the document, and apply its values to all links found in the document. Also remove the tag once it has been applied.
Method rewrite​_links Rewrite all the links in the document. For each link link_repl_func(link) will be called, and the return value will replace the old link.
Method set set(self, key, value=None)
Method text​_content Return the text content of the tag (and the text in any children).
Property base​_url Returns the base URL, given when the page was parsed.
Property body Return the <body> element. Can be called from a child element to get the document's head.
Property classes A set-like wrapper around the 'class' attribute.
Property forms Return a list of all the forms
Property head Returns the <head> element. Can be called from a child element to get the document's head.
Property label Get or set any <label> element associated with this element.
@checked.setter
def checked(self, value):

Undocumented

@type.setter
def type(self, value):

Undocumented

@value.deleter
def value(self):

Undocumented

@value.setter
def value(self, value):

Undocumented

@property
checkable =
Boolean: can this element be checked?
@property
checked =

Boolean attribute to get/set the presence of the checked attribute.

You can only use this on checkable input types.

@property
type =
Return the type of this element (using the type attribute).
@property
value =

Get/set the value of this element, using the value attribute.

Also, if this is a checkbox and it has no value, this defaults to 'on'. If it is a checkbox or radio that is not checked, this returns None.