Friday, 21 January 2022

Re: Using Netsurf cookies with wget

On 21 Jan 2022 as I do recall,
Jeremy Nicoll - ml netsurf wrote:

> On 2022-01-21 00:55, Harriet Bazley wrote:
>
> > I also tried using --post-data 'user-Login=USER&user_password=PASSWORD'
> > with no result,
>
> That /may/ be because you weren't careful enough coding that. According
> to the form code, the login variable isn't called "user-Login" but
> instead (2 differences) "user_login".

No - unfortunately it looks as if that was just sloppy transcription.
The actual data in my test script is "user_login". :-(


>
> Also, the form when used on a webpage, sets variable "user_remember_me"
> and (I'm not completely sure) maybe also the submit button part sets
> something - I don't know why it defines a name and a value - the latter
> is the text on the button but what's "name" for?

That's just a 'Remember Me' (and don't ask for log-in again but redirect
to the stats page) button.
I'm afraid I don't know enough about HTML forms to understand exactly
what the Submit button is doing, but the page only prompts for two user
inputs in this form.

(There are other forms on that page, e.g. a search box to search the
site, but I'm assuming that provided I supply the correct id/input pairs
the server will act on the data from the correct form - the trouble is
that I understand very little of what I am actually doing here and am
basically poking around at random.)

>
>
> I haven't used Netsurf for ages, but in Firefox one can see in its logs
> what URLs are built and sent back to a server - indeed in developer
> tools one can see the "curl" equivalent command to each communication
> with a server. Really the simplest way to recreate something is to
> look at what the browser actually does.

Yes, that was the recommendation on the Web page that suggested using
the --post-data method: simply 'turn on development tools'.
Unfortunately so far as I know Netsurf doesn't provide access to sniff
around at that level.

You can't read the log in !Scrap while the browser is actually running,
which makes looking at that a little tricky, and it gives a *lot* of
data that is nothing to do with curl fetches. But all I'm seeing is
HTTP status codes, e.g.

(16.330000) [INFO netsurf] content/fetchers/curl.c:1200 fetch_curl_process_headers: HTTP status code 200

And then way, way down the page

(17.460000) [INFO netsurf] content/handlers/html/html.c:126 fire_generic_dom_event: Dispatching 'click' against 0x55ef7118
(18.690000) [INFO netsurf] content/handlers/html/html.c:203 fire_dom_keyboard_event: Dispatching 'keydown' against 0x55d2d690
(18.960000) [INFO netsurf] content/handlers/html/html.c:203 fire_dom_keyboard_event: Dispatching 'keydown' against 0x55d2d690

etc., which is me typing passwords.

Lots of things being removed on the submission of the form:

(20.030000) [INFO netsurf] content/handlers/html/html.c:1192 html_destroy: content 0x55a955c0
(20.030000) [INFO netsurf] content/handlers/html/form.c:1460 form_free_control: Control:0x55e20698 name:0x55e1ca48 value:0x55b1e9f0 initial:0x0
(20.030000) [INFO netsurf] content/handlers/html/form.c:1460 form_free_control: Control:0x55e6f2e0 name:0x55e6f2c8 value:0x55e6f348 initial:0x55e6ea88
(20.030000) [INFO netsurf] content/handlers/html/form.c:1460 form_free_control: Control:0x55e42780 name:0x0 value:0x55e42000 initial:0x0
(20.030000) [INFO netsurf] content/content.c:695 content_remove_user: content file:///NetSurf:/Resources/CSS (0x55b62098), user 0x16c498 0x55a92c28

Then the browser history getting updated with the new page and a
FETCH_REDIRECT from the login page to the user home page. No record of
what data was sent to the server, that I can see.

But as I said, I understand very little of what is going on.

--
Harriet Bazley == Loyaulte me lie ==

Death is nature's way of telling you to slow down.
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org

No comments:

Post a Comment