Selenium::Firefox for JavaScript - enabled web scraping
Let's do JavaScript-enabled web scraping with Selenium::Firefox. Selenium::Firefox is Selenium::Remote::Driver customized for Firefox.
# Generate driver. The following two are the same, but only work with Firefox 48+. my $driver = Selenium::Firefox->new; $driver = Selenium::Firefox->new(marionette_enabled => 1); # Do something # Shut down the driver $driver->shutdown_binary; # For Firefox 47 and if it's too old. Marionettes are disabled. $driver = Selenium::Firefox->new(marionette_enabled => 0); $driver->shutdown_binary; </pre>
Preparation of execution environment
For Mac
Using Selenium from Perl The environment construction procedure will be helpful.