【问题标题】:Interacting with a file dialog与文件对话框交互
【发布时间】:2013-10-24 18:35:36
【问题描述】:

我希望使用 splinter 浏览文件并打开它。我设法在 Firefox 中打开了对话框,但我不知道如何与之交互。例如,如何选择文件并选择“打开”。文件对话框中的元素是否具有与 html 相关的名称?

【问题讨论】:

    标签: python html splinter


    【解决方案1】:

    你不能这样做。您可以使用文件输入字段的填充方法来模拟这一点。所以像:

    browser.find_by_id('file_input').fill(path-to-file)
    

    【讨论】:

      猜你喜欢
      • 2012-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多