Ceci est mon code.
import requests
from sys import exit
proxies = {
"http": "127.0.0.1:8888",
"https": "127.0.0.1:8888",
}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0",
"Accept-Encoding": "gzip, deflate",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Connection": "keep-alive"
}
login_page = "http://www.test.com/login/"
r = requests.get(login_page, proxies = proxies, headers = headers)
original_cookies = r.cookies
exit(0)
C'est ce que j'ai obtenu de Fiddler2. Comme vous pouvez le voir, il a ajouté un en-tête supplémentaire Accept-Encoding: identity
.
GET http://www.test.com/login/ HTTP/1.1
Accept-Encoding: identity
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Host: www.test.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Je utilise Python 3.3.2 sur Windows 7 64 bits et requests 1.2.3.
Quelqu'un peut-il donner quelques suggestions?
Merci.