【问题标题】:Javascript scrape clean up - TMviewJavascript 抓取清理 - TMview
【发布时间】:2019-04-24 17:12:45
【问题描述】:

我使用 chrome 扩展为数据库抓取数据,需要 JavaScript 清理功能的帮助。

输出是一个 .xls 文件,我通过运行 javascript 来删除不需要的数据。

Current output 我需要删除没有任何日期的行中的独立“ - ”。

我已经尝试过这个解决方案 - 但它不会让我在超过 1 列中这样做。

    this.values[9] = this.values[9];
    let [day, month, year] = this.values[9].split("-");
    this.values[9] = this.values[9].replace("-","")
    this.values[9] = `${day}-${month}-${year}`;

this.values[9] = this.values[9];在这种情况下,我是如何定位脚本中的应用程序日期行的

非常感谢任何指导!

【问题讨论】:

    标签: javascript


    【解决方案1】:
    this.values[9] = this.values[9] == "-" ? "" : this.values[9];
    

    【讨论】:

      猜你喜欢
      • 2016-07-03
      • 1970-01-01
      • 2017-09-18
      • 2018-06-30
      • 1970-01-01
      • 2018-05-12
      • 1970-01-01
      • 2019-11-28
      • 2020-10-03
      相关资源
      最近更新 更多