【问题标题】:Interact with a webpage containing dynamic list using Python使用 Python 与包含动态列表的网页交互
【发布时间】:2015-03-24 00:39:20
【问题描述】:

我正在尝试编写一个 Python 程序来自动将任务添加到 todoist。我目前正在尝试使用 mechanize 但不确定这是否是我需要的,因为它设置为与表单交互,我不确定 todoist 是否使用 HTML 表单进行输入。到目前为止,这是我的代码:

import mechanize;
import re;

br = mechanize.Browser();
br.open("http://todoist.com/");
assert br.viewing_html();
print br.title();
print br.forms();

打印出来的

To-do list and task manager. Free, easy, online and mobile: Todoist
<generator object __call__ at 0x02D69288>

所以它已成功连接到 todoist,但我不确定如何访问输入表单以实际将任务放入?也不确定为什么 br.forms() 打印引用而不是值(这是一个空列表)?

【问题讨论】:

    标签: python html mechanize todoist


    【解决方案1】:

    已经有一些模块可以让我与 todoist API 交互。如果有人搜索相同的问题,这个似乎运行良好:https://github.com/Garee/pytodoist

    【讨论】:

    猜你喜欢
    • 2016-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多