Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用带有地理位置的请求问题与python进行Webscraping_Python_Web Scraping_Request_Geolocation - Fatal编程技术网

使用带有地理位置的请求问题与python进行Webscraping

使用带有地理位置的请求问题与python进行Webscraping,python,web-scraping,request,geolocation,Python,Web Scraping,Request,Geolocation,我目前正在请求和使用代理来删除amazon.com网站 我正在使用python3的请求模块 我面临的问题是,amazon根据代理的地理位置返回结果,而不是amazon.com在美国的结果 我如何确保只从美国获得亚马逊网站的搜索结果 这是我的密码: import requests url = 'https://www.amazon.com/s?k=a%20circuit' proxy_dict = # Proxy details in the dictionary form response =

我目前正在请求和使用代理来删除amazon.com网站

我正在使用python3的请求模块

我面临的问题是,amazon根据代理的地理位置返回结果,而不是amazon.com在美国的结果

我如何确保只从美国获得亚马逊网站的搜索结果

这是我的密码:

import requests
url = 'https://www.amazon.com/s?k=a%20circuit'
proxy_dict = # Proxy details in the dictionary form
response = requests.get(url, proxies=proxy_dict, timeout=(3, 3))
htmlText = response.text
# I am than saving the details in a text file.
代码工作正常,但它确实返回代理位置的结果

我如何才能确保结果只针对美国?
Shell我可能会在url或标题上添加一些内容

你的代理人在哪里?你得到了什么结果?Hi@RobertKearns代理分布在世界各地(不是单个代理或位置),而且它们是随机的。就结果而言,我得到了所有需要的结果,但是基于代理请求的位置。你的代理在哪里?你得到了什么结果?Hi@RobertKearns代理分布在世界各地(不是单个代理或位置),而且它们是随机的。在结果方面,我得到了所有需要的结果,但是基于代理请求的位置。