0

I'd be glad if you could help me useing python urllib or request to login to a website with a following form where there is no target or action:

<form class="form-horizontal" method="post" action="">
<strong>Login: </strong><input type="text" id="username" name="username" placeholder="Username">
<input type="password" id="password" name="password" placeholder="Password"> 
<input type="submit" name="submit" value="Login">
</form>

Probably the website has a json or jquery, but I couldn't see the post method or target or any script in the source code of the website (probably it is server side)

I'd appriciate any help. Also if I need to adjust the title, I am open to suggestions

Nabi
  • 373
  • 1
  • 4
  • 12
  • A no action given in form usually means its submitting to the same page. So you can add the page you are on as the target your urllib script. – Anup Sep 27 '16 at 21:36
  • 2
    Possible dup of: http://stackoverflow.com/questions/11892729/how-to-log-in-to-a-website-using-pythons-requests-module – Gillespie Sep 27 '16 at 21:39
  • @user1690718 : Thanks this was the answer. I tried it and was successful using using the request library of python 3 as in the link above. The trick to post to the same url was not clear for me indeed – Nabi Sep 27 '16 at 22:22

1 Answers1

0

I agree with the hypothesis consisting of that website use Jquery/JS to (async) post the login/password.

Anyway you may use some web development tool (like firebug) to double-check or record network GET/POST requests when you try to login on the site.

After the network tab's activation under the web development tool, you will see the request.

Sometimes authentication could also be processed via websocket or flash

A STEFANI
  • 6,434
  • 1
  • 21
  • 41