首页 > 解决方案 > Javascript 抓取清理 - TMview

问题描述

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

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

当前输出 我需要删除没有任何日期的行中的独立“ - ”。

我已经尝试过这个解决方案 - 但它不会让我在超过 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

解决方案


this.values[9] = this.values[9] == "-" ? "" : this.values[9];

推荐阅读