Python post to remote host

61 views
Skip to first unread message

alireza Rahmani khalili

unread,
Sep 8, 2016, 8:00:11 AM9/8/16
to Django users

Hi I want to write robot to register in toefl test , I send request to remote web site as:

from django.http import HttpResponse

import requests

from bs4 import BeautifulSoup
from django.middleware import csrf


def index(request):
    session = requests.Session()
    page = session.get('https://toefl-registration.ets.org/TOEFLWeb/extISERLogonPrompt.do')


    if request.method == 'POST':
        url = 'https://toefl-registration.ets.org/TOEFLWeb/logon.do'
        data = {
                'password': request.POST.get('password', ''),
                'username': request.POST.get('username', ''),
                'org.apache.struts.taglib.html.TOKEN': request.POST.get('org.apache.struts.taglib.html.TOKEN', '')
               }

        page = session.post(url, data=data)


    return HttpResponse(request,page.text)

My post request is not same as post request made by toefl original web site and instead of login shows error as : We are sorry, our servers are currently busy. Please wait a few minutes and retry your request.

what is the problem? someone in other corporation did this without error

Luis Zárate

unread,
Sep 8, 2016, 12:43:08 PM9/8/16
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/75c2e724-5616-41d6-9c0d-cdef3887d3e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


Reply all
Reply to author
Forward
0 new messages