回答
感谢所有我发现这个导入httplib >>> conn = httplib.HTTPConnection(“www.python.org”) >>> conn.request(“GET”,“/index.html”) >>> r1 = conn.getresponse() >>> print r1.status,r1.reason 200 OK >>> data1 = r1.read() >>> conn.request(“GET”,“/parrot.spam” ) >>> r2 = conn.getresponse() >>> print r2.status,r2.reason 404 Not Found >>> data2 = r2.read() >>> conn.close()in链接.....我认为它现在足够wud ..... – Hulk 2009-12-12 11:33:04
@Hulk:该评论是问题的一部分。你拥有这个问题。您可以使用其他信息更新问题。请更新问题并删除这个愚蠢的评论。 – 2009-12-12 12:48:25
我发现Urllib2在大多数情况下就足够了。它非常支持密码,身份验证和cookie。 Cookielib可能也有帮助。
- 1. 通过ASP.net发送HTTP发布请求
- 2. 通过ASP.NET C发送HTTP请求#
- 3. 通过AJAX发送http请求
- 4. 通过HTTP发送REST请求
- 5. 如何通过TCPSocket发送HTTP请求?
- 6. 通过php发送多个http请求
- 7. 通过http请求发送彩信
- 8. 通过Google App脚本中的UrlFetchApp发送的HTTP发布请求
- 9. python,通过一个网络连接发送很多HTTP请求
- 10. 通过Python发送多个HTTP请求的理想方法?
- 11. 通过Net :: HTTP发送Ruby中的http发布请求
- 12. 如何通过python脚本路由HTTP请求?
- 13. 发送HTTP请求
- 14. 发送HTTP请求
- 15. 如何通过perl脚本向weblogc服务器发送http请求
- 16. 通过http请求通过Malign发送消息
- 17. 如何发送通过URL连续请求:Python的请求
- 18. 如何通过http请求发送文件到http服务器
- 19. 通过cURL向Google App脚本发送请求
- 20. Python - 同时发送HTTP请求
- 21. 通过发送请求发送到PHP脚本的XML文档对象
- 22. 通过请求头发送数据与通过请求主体发送数据
- 23. 如何通过springXD发送http-client发布请求
- 24. 通过HTTP请求发送发布数据POST
- 25. 通过curl发送http请求时发生错误
- 26. 与版本Http/0.9发送的请求
- 27. 发送HTTP请求(验证请求)
- 28. 从MSBuild脚本发出HTTP请求
- 29. 发送HTTP POST请求
- 30. JAVA发送POST http请求
这个问题是非常类似于http://stackoverflow.com/questions/1893119/python-script-to-login-to-a-url-那里有一个更详细的答案。 – 2009-12-12 13:41:16