python - python Ghost.py不支持的字段标签错误

标签 python error-handling ghost.py

<div class="Rd" guidedhelpid="sharebox_editor">
<div class="eg">
<div class="yw oo"></div>
<div class="yw VK"></div>
</div>
<div class="URaP8 Kf Pf b-K b-K-Xb">
<div id="207" class="pq">Share what's new...</div>
<div id=":3s.f" class="df b-K b-K-Xb URaP8 editable"   contenteditable="true"g_editable="true" role="textbox" aria-labelledby="207"></div>

我正在做的是这样的:
ghost.set_field_value(".df.b-K.b-K-Xb.URaP8.editable[role=textbox]", "jeanphix")

我收到“不支持的字段标签”错误

最佳答案

根据github来源,可以找到您的元素(否则会得到“找不到元素”错误)。但是,ghost.py仅允许将某些HTML标记与set_field_value(..)方法一起使用:select,textarea,和输入(各种类型)。

由于您要在DIV上进行尝试,因此它会引发不受支持的标记错误异常。 “提高”在github上当前版本的第830行上:https://github.com/jeanphix/Ghost.py/blob/dev/ghost/ghost.py在此之前检查if/else语句,您应该能够明白我的意思

关于python - python Ghost.py不支持的字段标签错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26937587/

相关文章:

python - `py.test` 和 `__init__.py` 文件

c# - 如何解析ODATA错误

javascript - Ghost.py - 单击特定按钮

django - 如何从 Jenkins 运行 casperjs javascript 测试?

python - Ghost 不起作用

python - 检查是否从R安装了Python

Python 属性错误

python - 创建新行并根据时间间隔重复这些值(如果它们属于)

error-handling - 如何从已发布的 Web Api 中获取详细信息异常

python - 从Python SDK调用时,从Azure存储 “connection reset” 10054错误中恢复的正确方法是什么?