headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.48k stars 159 forks source link

Reddit login not working #5

Closed girishso closed 9 years ago

girishso commented 9 years ago

Reddit login example from Readme fails with "wrong password" message.

Is it because clicking Reddit "login" button seems to send an ajax request (in browser)?

Any ideas how to fix it?

coocheenin commented 9 years ago

Yes, POST request goes to https://www.reddit.com/api/login/user, response is in JSON. You can see all requests fields in browser console.

girishso commented 9 years ago

Investigated it further... it's not an ajax/javascript issue. For some reason passwd field value is not getting submitted on fm.Submit

mholt commented 9 years ago

If it's anything like the GitHub login form, then the fix is sitting in #8. The passwd field probably isn't being added to the list of the form's fields because its initial value is empty.