[英]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 /端口組合,但我仍然得到EUR價格。 難道我做錯了什么?
proxies
字典應具有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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.