I can't seem to figure out how to close a tab when using WWW::Mechanize::Chrome.
my $mech = WWW::Mechanize::Chrome->new();
$mech->get('https://www.google.com/');
There is no $mech->close_tab() method.
So the question is, how do you close the tab you're currently working with?
my $driver = $mech->driver
Seems to return the Chrome::DevToolsProtocol instance.
Then in order to close the tab, you have to call the close_tab() function and pass the current tab as the argument:
$mech->driver->close_tab($mech->tab);
This approach is generating the following error but it does close the tab:
Calling ->catch in void context at C:/Perl64/site/lib/Chrome/DevToolsProtocol.pm line 567