【问题标题】:Automating Google Form with javascript使用 javascript 自动化 Google 表单
【发布时间】:2020-11-26 02:55:46
【问题描述】:

我尝试用必填字段填写 Google 表单(example)。 我使用“值”字段填写文本,但仍然收到错误消息: “这是一道必答题”

这是我的 javascript 代码:

document.querySelectorAll(".quantumWizTextinputPaperinputInput")[0].value = "My answer here"

我也尝试过点击、聚焦和更改错误属性。

【问题讨论】:

  • 我认为是故意这样做的,以避免这种类型的自动填充
  • 那么,没有解决办法吗?
  • 我认为不要..

标签: javascript automation google-forms queryselector


【解决方案1】:

嗯,我有两个建议;

// try with setAttribute function
document
  .querySelectorAll(".quantumWizTextinputPaperinputInput")[0]
  .setAttribute("value", "My answer here");

// Maybe more than one element returns?
document
  .querySelectorAll(".quantumWizTextinputPaperinputInput")
  .forEach((elm) => (elm.value = "My answer here"));

【讨论】:

  • 还是不行。文本出现,但超出了默认文本。此外,在提交表单时,会出现一条错误消息。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-04
  • 2020-10-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多