Python How to post form with request -


After

I want to use the request to post the form with the dragon and request it has 2 value form with the user And pass them to the present. Form method = "post" action = "/ maxverif / 0" name = "loginf" id = "connect" & gt; P>

you can please me
  & lt; & Lt; p class = "title" & gt; Connect & lt; / P & gt; & Lt; div class = "before" & gt; & Lt; div class = "ques" & gt; & Lt; Div class = "name" & gt; Mail: & lt; / Div & gt; & Lt; div class = "input" & gt; & Lt; Input type = "text" name = "user" /> gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "question" & gt; & Lt; Div class = "name" & gt; Near & lt; / Div & gt; & Lt; div class = "input" & gt; & Lt; Input type = "password" name = "pass" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; Div class = "button" & gt; & Lt; Input type = "submit" value = "trens" id = "connect" /> & Lt; / Div & gt;   

Python:

  import request url = 'https://www.domains.com/store/verify/' parameter2 = {'user' : 'hhhhh@gmail.com', 'pass': '123456'} parameter = urllib.urlencode (parameters2) request = urllib2.Request (url, parameter) response = urllib2.urlopen (requested) data = response.read () Html = etree.HTML (data) print html   

And when I print HTML and I do not see that the form has been posted TKS < / Div>

Hi I got a solution and I Create this

  CJ = cookielib.CookieJar () Opener = urllib2.build_opener (urllib2.HTTPCookieProcessor (cJ)) login_data = urllib.urlencode ({'user': 'hhhhh@gmail .com ',' pass ':' 123456 '}) opener.open (' https://www.domains.com/store/verify/ ', login_data) hh = opener.open (' https://www.domains .com / store / verify / ', login_data) print hh.read ()   

Tks

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -