WWW::WebKit2 - Perl extension for controlling an embedding WebKit2 engine
use WWW::WebKit2; my $webkit = WWW::WebKit2->new(xvfb => 1); $webkit->init; $webkit->open("http://www.google.com"); $webkit->type("q", "hello world"); $webkit->click("btnG"); $webkit->wait_for_page_to_load(5000); print $webkit->get_title;
WWW::WebKit2 is a drop-in replacement for WWW::Selenium using Gtk3::WebKit2 as browser instead of relying on an external Java server and an installed browser.
None by default.
WWW::WebKit saves console messages in this array but still lets the default console handler handle the message. I'm not sure if this is the best way to go but you should be able to override this easily:
use Glib qw(TRUE FALSE); $webkit->view->signal_connect('console-message' => sub { push @{ $webkit->console_messages }, $_[1]; return TRUE; });
The TRUE return value prevents any further handlers from kicking in which in turn should prevent any messages from getting printed.
Initializes WebKit2 and GTK3. Must be called before any of the other methods.
See WWW::Selenium for API documentation. See Test::WWW::WebKit for a replacement for Test::WWW::Selenium. See Test::WWW::WebKit::Catalyst for a replacement for Test::WWW::Selenium::Catalyst.
The current development version can be found in the git repository at: https://github.com/jscarty/WWW-WebKit2
Jason Shaun Carty <jc@atikon.com>, Philipp Voglhofer <pv@atikon.com>, Philipp A. Lehner <pl@atikon.com>
Copyright (C) 2020 by Jason Shaun Carty, Philipp Voglhofer and Philipp A. Lehner
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.
To install WWW::WebKit2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::WebKit2
CPAN shell
perl -MCPAN -e shell install WWW::WebKit2
For more information on module installation, please visit the detailed CPAN module installation guide.