我试图使用或更改IP地址,并对所有可访问的公共数据进行web抓取,但我无法找到解决方案。我正在尝试做一个旋转的ip地址。我在Windows 10和Anaconda IDE上。例如,我在下面执行以下代码:
import requests
domain = "https://www.undernews.fr"
#define your proxies
#the socks5h method allows the socks server to translate the #hostname. So make sure that you add 'socks5h'.
这也许是个奇怪的问题,但请跟我说。我使用Azure托管代理进行持续部署。在发布期间,我有一个任务,将一行添加到宿主代理上的主机文件中。以前,主机文件如下所示:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individ