通过代理发送请求不起作用
Sending a request via proxy doesn't work
我需要在 python 中发送带有 requests
的 http
请求。代理需要在美国,这样我才能得到美国货币。
到目前为止我这样做了:
import requests
proxies = {'httpс': 'httpс://97.77.104.22:3128'}
response = requests.get("https://www.ncl.com/ca/en/search_vacations?cruise=1&cruiseTour=1&cruiseHotel=1&cruiseHotelAir=1&flyCruise=1&numberOfGuests=4294953449&state=undefined&pageSize=10¤tPage=", proxies=proxies)
cruise_results = response.json()
for line in cruise_results['results']:
print(line)
尝试了几种不同的 IP/Port 组合,但我仍然得到欧元价格。我做错了什么吗?
proxies
dictionary 应该有 http
和 https
键。 不 httpc
import requests
proxies = {'https': 'httpс://97.77.104.22:3128'}
response = requests.get("https://www.ncl.com/ca/en/search_vacations?cruise=1&cruiseTour=1&cruiseHotel=1&cruiseHotelAir=1&flyCruise=1&numberOfGuests=4294953449&state=undefined&pageSize=10¤tPage=", proxies=proxies)
我需要在 python 中发送带有 requests
的 http
请求。代理需要在美国,这样我才能得到美国货币。
到目前为止我这样做了:
import requests
proxies = {'httpс': 'httpс://97.77.104.22:3128'}
response = requests.get("https://www.ncl.com/ca/en/search_vacations?cruise=1&cruiseTour=1&cruiseHotel=1&cruiseHotelAir=1&flyCruise=1&numberOfGuests=4294953449&state=undefined&pageSize=10¤tPage=", proxies=proxies)
cruise_results = response.json()
for line in cruise_results['results']:
print(line)
尝试了几种不同的 IP/Port 组合,但我仍然得到欧元价格。我做错了什么吗?
proxies
dictionary 应该有 http
和 https
键。 不 httpc
import requests
proxies = {'https': 'httpс://97.77.104.22:3128'}
response = requests.get("https://www.ncl.com/ca/en/search_vacations?cruise=1&cruiseTour=1&cruiseHotel=1&cruiseHotelAir=1&flyCruise=1&numberOfGuests=4294953449&state=undefined&pageSize=10¤tPage=", proxies=proxies)