cURL / Mailing Lists / curl-library / Single Mail


Re: Questions on wifi portal login

From: Fabian Keil <>
Date: Fri, 22 Feb 2013 19:00:42 +0100

Ben Greear <> wrote:

> I've been trying to get a slightly hacked version of curl to do
> an automated login to a wifi hotspot type of thing, but to date,
> I'm not having too much luck.
> I suspect part of the problem might be javascript related, but maybe
> it's user error. The final page I get from the AP talks about enabling
> cookies..though it seems they are properly enabled in curl.
> Does anyone see anything obviously wrong with this script below?

Did you already compare the resulting requests with the ones
made by a browser?

I'm currently writing a script to automatically extend my library
loans and the login procedure seems to require (besides cookies and
login data) the following steps:

1. Request the start page to scrape some kind of object id.
2. Use the object id from the previous page to request the
   login form and scrape another object id.
3. Use the object id from the previous page to submit the
   login data.

Not following these steps results in a misleading plain text
message and even after the login most pages require an object id
from a previous page and can't be accessed out of order as the
server seems to use some kind of state machine.

Maybe your AP expects a similar login dance.

> And second, are there any suggestions for doing something like scripting
> a 'real' browser such as firefox or google-chrome so that any funny javascript
> stuff is automatically taken care of? I'd have to integrate c-ares and
> hack the device & IP bindings into a not sure how hard
> that would be...

I don't remember the details, but a while ago I saw a presentation
about controlling Firefox with a cpan module through a telnet-like


List admin:

Received on 2013-02-22