Advertisement
pulser_777

Untitled

Jul 11th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.57 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use Selenium::Chrome;
  5.  
  6. my $objDrv = Selenium::Chrome->new(
  7.         'extra_capabilities' => {
  8.                 'chromeOptions' => {
  9.                         'args' => [
  10.                                 'headless',
  11.                                 'disable-gpu',
  12.                         ],
  13.                 },
  14.         },
  15. );
  16.  
  17. $objDrv->get('https://www.google.com/');
  18. $objDrv->capture_screenshot('testweb_chrome.png');
  19. print STDERR $objDrv->get_title(), "\n";
  20.  
  21. binmode STDOUT, ':utf8';
  22. print $objDrv->get_page_source();
  23.  
  24. $objDrv->quit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement