我正在尝试向此URL发送请求
https://verify-email.org/home/verify-as-guest/example@example.com
通过代理服务器。
我在这里获得了代理服务器:
https://free-proxy-list.net/
验证电子邮件网站有一个限制,每小时免费验证5封电子邮件。
当我使用代理服务器时,如果我不断改变代理服务器,我可以绕过这个限制。当我使用curl时,这是有效的:
curl --proxy http://IP:PORT https://verify-email.org/home/verify-as-guest/example@example.com
上面的命令工作得很好。
但是,当我在python中执行相同的操作时:
import requests
from pprint import pprint
def check_email(email):
proxyDict = {
"http" : 'http://IP:PORT'
}
result = requests.get('https://verify-email.org/home/verify-as-guest/' + email, proxies=proxyDict, timeout=5).json()
pprint(result)
check_email('example@example.com')
它不起作用。它只给了我5次尝试,然后停止工作,即使我更改了IP,这使我相信curl发送的请求和请求发送的请求有区别。
有什么方法可以在Python请求中得到相同的“卷曲”请求吗?