Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, how can I extract the email button the js button on this page:
https://reporter.nih.gov/project-details/10573139Here's some code I've written that gives me a pdf but I need to have the script click the button before I grab the pdf and I can't figure that out. I tried to see if I could 'tab' to it as I could automate that with 13 tabs and a return or something but the button doesn't select. Any ideas/help are greatly appreciated.
use strict; use File::Spec; use File::Basename 'dirname'; use Log::Log4perl qw(:easy); use WWW::Mechanize::Chrome; my $url = 'https://reporter.nih.gov/project-details/11011199'; my $mech = WWW::Mechanize::Chrome->new( headless => 1, # otherwise, PDF printing will not work ); print "Loading $url"; $mech->get($url); sleep 5; my $fn= 'screen.pdf'; my $page_pdf = $mech->content_as_pdf( filename => $fn, ); print "\nSaved $url as $fn\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I extract an email behind a JS button?
by Corion (Patriarch) on Mar 15, 2024 at 06:47 UTC | |
by Anonymous Monk on Mar 15, 2024 at 22:23 UTC | |
by Corion (Patriarch) on Mar 16, 2024 at 07:23 UTC | |
by Anonymous Monk on Mar 18, 2024 at 15:57 UTC | |
by Corion (Patriarch) on Mar 18, 2024 at 18:01 UTC | |
|
Re: How can I extract an email behind a JS button?
by cavac (Prior) on Mar 15, 2024 at 19:23 UTC | |
by Anonymous Monk on Mar 15, 2024 at 22:25 UTC |