【问题标题】:Mechanical Turk Failure to Parse HTML5 - how best to check it?Mechanical Turk 无法解析 HTML5 - 如何最好地检查它?
【发布时间】:2019-01-15 05:19:24
【问题描述】:

在尝试一组简单 HIT 的测试批次时,我发现提交按钮不起作用。然后我注意到,在查看 Layout ID 时,它说 There was an error parsing the HTML5 data in your hit template. 这只是我根据现有模板手工构建的快速 HIT,但我想我一定是在某个地方搞砸了 HTML,因为我是通过手。

当我尝试将我的 HIT 源复制/粘贴到 W3 验证器中时,它所抱怨的并不是我接触的模板的一部分,而且主要是因为我的源不是完整的HTML 文档,因为 MTurk 将包装它:

Warning: Consider adding a lang attribute to the html start tag to declare the language of this document.
Error: Start tag seen without seeing a doctype first. Expected <!DOCTYPE html>.
Error: Element head is missing a required instance of child element title.
Warning: The type attribute for the style element is not needed and should be omitted.

是否有一种简单的方法可以访问 HIT 的完整包装 HTML 以进行验证?或者一些更好的方法来解决我的 HTML。

【问题讨论】:

    标签: html mechanicalturk html5-validation


    【解决方案1】:

    您是正确的,MTurk 将包装您提供的 HTML。您可以在 HTMLQuestion. 的文档中看到它添加的样板 XML。这些文档适用于使用 API 的开发人员,但它会向您展示您的 HTML 发生了什么。

    也就是说,这应该没关系。只需制作有效的 HTML,就可以了。例如,当 Workers 执行您的任务时,&lt;title&gt; 标记不会显示,但将其保留不会造成任何损害。

    另外,一个常见的错误是在第一行省略&lt;!DOCTYPE html&gt;。它是 HTML 规范的一部分,但浏览器对此并不严格,所以大多数人不这样做。但是,如果您忽略它,MTurk 和 W3 验证器都会对您咆哮。

    【讨论】:

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