Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: login to a secure web site via JavaScript

by daxim (Curate)
on May 15, 2019 at 11:16 UTC ( [id://11100013]=note: print w/replies, xml ) Need Help??


in reply to login to a secure web site via JavaScript

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100013]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found