vendredi 22 février 2019

Python "requests" returns only "Response [403]"

I am trying to automatically process some data on a webpage using the requests package of Python but I just get "Response [403]" as return value. What am I doing wrong? Here is the minimal (not)working example:

import requests

url = 'http://tools.iedb.org/mhcii/'
seq = "GGPKLRGNVTSNIKFPSDNKGKIIRGSNDKLNKNSEDVLEQSEKSLVSENVPSGLDIDDI"

form_data = {'sequence_text': seq,
             'submit': 'submit'}

response = requests.post(url, data=form_data)

print(response)

I have also tried to give it an extra header with browser information as suggested in here and here but the response still stays the same. Ideas?




Aucun commentaire:

Enregistrer un commentaire