I want to request the url with random proxies, but it shows an error message AttributeError: 'str' object has no attribute 'get'. Do you know how can I fix this?
import requests
import random
proxies = {
'http': 'http://20.97.28.47:8080',
'https': 'https://20.97.28.47:8080',
'http': 'http://202.77.120.38:57965',
'https': 'https://202.77.120.38:57965'
}
randomproxies=random.choice(list(proxies.values()))
url="http://www.yahoo.com.hk"
r=requests.get(url, proxies=randomproxies)
Aucun commentaire:
Enregistrer un commentaire