So, this module uses HTML::Selector::XPath and only supports the CSS 3 selector supported by that module. Web::Query doesn't support jQuery's extended queries(yet?). If a selector is passed as a scalar ref, it'll be taken as a straight XPath expression.

FUNCTIONS

This is a shortcut for Web::Query->new($stuff). This function is exported by default.

METHODS

CONSTRUCTORS

my $q = Web::Query->new($stuff, \%options )

Create new instance of Web::Query. You can make the instance from URL(http, https, file scheme), HTML in string, URL in string, URI object, and instance of HTML::Element.

This method throw the exception on unknown $stuff.

This method returns undefined value on non-successful response with URL.

Currently, the only two valid options are indent, which will be used as the indentation string if the object is printed, and no_space_compacting, which will prevent the compaction of whitespace characters in text blocks.

html

insert_before

Insert every element in the set of matched elements before the target.

insert_after

Insert every element in the set of matched elements after the target.

prepend

Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.

remove

Delete the elements associated with the object from the DOM.

# remove all <blink> tags from the document
$q->find('blink')->remove;

remove_class

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.

replace_with

Replace the elements of the object with the provided replacement. The replacement can be a string, a Web::Query object or an anonymous function. The anonymous function is passed the index of the current node and the node itself (with is also localized as $_).