Salut
je veux extraire la cline d'une page web avec méthode post mait j'ai une erreure: name "re" is not defined
python moncode.py
voici mon code:
def postData(url, host, Referer):
import requests
import urllib2
import re
headers = {'Host': host,
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:62.0) Gecko/20100101 Firefox/62.0',
'Accept': '*/*',
'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept-Encoding' : 'deflate',
'X-Requested-With': 'XMLHttpRequest',
'Referer': Referer,
'Connection': 'keep-alive'}
params={"Dream":d,"CS":"cs","btn":"Dream-CS"}
s = requests.Session()
r = s.post(url, headers=headers, data=params)
htmldata = r.content
print params
return htmldata
d
(…)