【问题标题】:CasperJS download an Excel file from dialog boxCasperJS 从对话框下载 Excel 文件
【发布时间】:2014-02-16 00:32:05
【问题描述】:

我是 CasperJS 的新手,我正在尝试从对话框下载(保存到磁盘)一个 CSV 文件。使用 firefox 配置文件,通过设置浏览器配置文件属性将相当简单。有什么建议如何在 casperjs 中下载 excel 文件?

profile = webdriver.firefox.firefox_profile.FirefoxProfile() profile.set_preference("browser.download.folderList",2) profile.set_preference("browser.download.dir",self.opts['output_dir']) profile.set_preference('browser.helperApps.neverAsk.saveToDisk', ('application/octet-stream,application/msexcel'))

我已阅读有关避免对话框等的链接,但在这种情况下,它是必需的。

【问题讨论】:

    标签: selenium selenium-webdriver casperjs


    【解决方案1】:

    您可以使用 download() 方法。见文档:http://docs.casperjs.org/en/latest/modules/casper.html#download

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多