获取中间带有代理的 URL

发布于 2024-12-15 16:36:07 字数 358 浏览 3 评论 0原文

我正在使用 urllib2 来获取任何网站。通常,在浏览时,浏览器中会配置一个脚本,即有一个指向该脚本位置的链接,在

tools->internet options->connections->lan settings

如何合并该脚本中给出,如果没有该脚本,则不会获取页面。

我也尝试过这个

Proxy With urllib2

但它谈到了代理身份验证 407 错误。

如何继续,有人可以帮助我吗!

I am using urllib2 to obtain any site. Normally while browsing there is a script that is configured in browser i.e there is a link to the location of that script given in

tools->internet options->connections->lan settings

How do I incorporate that, without that script the pages arent fetched.

I also tried this

Proxy With urllib2

But it talks about proxy authentication 407 error.

How to go forward with,could anyone please help me out!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执妄 2024-12-22 16:36:07

您需要设置http_proxy变量,其语法为:

HTTP_PROXY=http://user:[电子邮件受保护]:port/

在 Windows 中,右键单击我的电脑 >属性>高级>环境变量

您将看到用户变量和系统变量。系统变量是通用的(适用于任何登录用户),要更改它们,您需要管理员级别的访问权限。用户变量适用于您的帐户,您无需管理员访问权限即可修改它们。

单击您喜欢的选项上的“新建”并设置环境变量。

You need to set the http_proxy variable, syntax of which is:

HTTP_PROXY=http://user:[email protected]:port/

In Windows, right click on My Computer > Properties > Advanced > Environment Variables

You will see user variables and system variables. System variables are universal (will work for any logged in user), and to change them you need administrator level access. User variables work for you account and you can modify them without administrator access.

Click New on whichever one you prefer and set the environment variables.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文