Thursday, September 8, 2016

Python post to remote host

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

--
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-users@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.

No comments:

Post a Comment