如何在python中使用代理并扭曲来获取页面

发布于 2024-12-06 09:41:07 字数 447 浏览 5 评论 0原文

如果您有诸如 http://222.126.99.99:8909 之类的代理,您是否可以访问浏览器中的 url,例如 www.cnn.com http://222.126.99.99:8909/www.cnn.com

这是真的吗,从twisted我可以使用代理获取如下页面吗?

iUrl=http://222.126.99.99:8909/www.cnn.com
client.getPage(iUrl,method='GET').addCallback(self.processPage,iUrl).addErrback(self.printError,iUrl)

Is it true that if you have a proxy such as http://222.126.99.99:8909 that you can access a url from the browser e.g. www.cnn.com as http://222.126.99.99:8909/www.cnn.com.

Is this is true, from twisted can I use the proxy to get a page as follows?

iUrl=http://222.126.99.99:8909/www.cnn.com
client.getPage(iUrl,method='GET').addCallback(self.processPage,iUrl).addErrback(self.printError,iUrl)

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

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

发布评论

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

评论(1

心房的律动 2024-12-13 09:41:07

如果代理需要用户名和密码..我该如何修改 URL 以使用凭据?

格式为:

url = 'http://username:password@host:port/path'

尽管它已已弃用

请注意,通过 http 发送您的用户名和密码并不安全

if the proxy requires a username and password..how do I do modify the URL to use the credentials?

The format is:

url = 'http://username:password@host:port/path'

Though it is deprecated.

Note, it is not safe to send your username and password over http.

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