Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: login to a secure web site via JavaScriptby daxim (Curate) |
on May 15, 2019 at 11:16 UTC ( [id://11100013]=note: print w/replies, xml ) | Need Help?? |
There are two fundamental problems.
1. Use of credentials method is wrong - this is for HTTP authentication, but archives.newyorker.com authenticates via Web form. 2. Your idea of what constitutes a session is different from the Web site. The User-Agent header clearly is not enough; most sites would carry a session in cookies. You would need to load Safari cookies into HTTP::Cookies::Safari and then feed that into LWP::UserAgent. If that doesn't work (which is likely, since LWP has not kept up at all with Web APIs in current use), try WWW::Scripter or WWW::Mechanize::Chrome instead.
In Section
Seekers of Perl Wisdom
|
|