【问题标题】:Using Twill or other http tool on https在 https 上使用 Twill 或其他 http 工具
【发布时间】:2012-02-05 06:23:48
【问题描述】:

我可以使用twill 登录到一个普通的HTTP 站点。但是,当我尝试登录 SSL 站点时,出现以下错误:

$ twill-sh

>> go http://www.google.com
==> at http://www.google.com

>> go http://itunesconnect.apple.com/WebObjects/iTunesConnect.woa

ERROR: No module named mechanize

current page:  *empty page* 

我收到此错误的原因是什么,我认为这与 iTunes 页面的安全性有关?以及如何通过命令行登录给定页面?

【问题讨论】:

  • 我不熟悉这个工具,但看起来 Twill 使用Mechanize。你应该可以使用 Python 常用的easy_install 机制来安装它。
  • 斜纹布使用自己的机械化和其他一些包。为此,它将它们添加到 sys.path。问题肯定与此有关,但这还没有给出线索。
  • 斜纹包文档在其 doc/problems.html 中提到了机械化的问题(最后,从 0.9 版开始)。

标签: python http curl https twill


【解决方案1】:

我相信,python-mechanize(它的 Ubuntu 名称,可能因其他系统而异),并且可能某些其他依赖项未在您的系统上安装(或删除)。虽然 twill 发行版提供了自己的机制,但发行版通常会确保做对。

在使用 sudo easy_install 之前,请考虑使用发行版的方式查找和安装软件包。

在 Ubuntu 上:

sudo apt-get install python-mechanize

【讨论】:

    猜你喜欢
    • 2014-03-14
    • 2013-05-05
    • 1970-01-01
    • 2023-02-08
    • 2014-08-24
    • 2011-10-21
    • 1970-01-01
    • 2020-09-17
    • 2016-11-12
    相关资源
    最近更新 更多