python - Confused as to which data needs to be passed to login (using requests) -


I have taken a look at the log data on the forum, even I am trying to login, but it still Makes me confused What information is required to pass through POST Is this the html id field? Name field? type?

In addition, when you successfully log on, then "Login is successful!" Quick redirect page, then you continue to redirect to index.php. The results I get are index.php, but this is not an example of me logging in. I believe that I am passing the cookies correctly? I believe this is the wrong data that is being passed on the login. Import import request from BS 4 import Beautiful Soup Import Jason Import String Header = {"User-Agent": "Mozilla / 5.0 (Windows NT 6.3; Win64; x64) AppleWebKit / 537.36 (like KHtml, Gecko) Chrome / 37.0.2049.0 Safari / 537.36 "} Payload = {" Action ":" Login "," Username ":" myusername "," password ":" ********** "} session () s In the form: s0 = s.post ("http://minewind.com/forums/ucp.php?mode=login", data = payload, header = header) get print (s.cookies) s1 = s (" Http://minewind.com/forums/index.php ", cookies = s0.cookies, header = h Eder) perty = beautiful soup (s1.content) perty.prettify () for link in perty.find_all ('a'): print (links.get ('href'))


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -