Skip to content

npx ota validate reports an InaccessibleContentError #1100

@michielbdejong

Description

@michielbdejong

I followed the instructions on https://docs.opentermsarchive.org/ and

npx ota track --services "Open Terms Archive" --types "Privacy Policy"

works, but

npx ota validate --services "Open Terms Archive" --types "Privacy Policy"

fails with the following output:

Service declarations validation
    Open Terms Archive
      ✔ valid declaration schema
      Privacy Policy
        https://opentermsarchive.org/en/privacy-policy
          ✔ fetchable URL
          1) selector matches an element in the source document
          [Tests skipped as content cannot be filtered]
          - filtered content has at least 100 characters
          [Tests skipped as content cannot be filtered]
          - content is consistent when fetched and filtered twice in a row


  2 passing (722ms)
  2 pending
  1 failing

  1) Service declarations validation
       Open Terms Archive
         Privacy Policy
           https://opentermsarchive.org/en/privacy-policy
             selector matches an element in the source document:
     InaccessibleContentError: The documents cannot be accessed or their contents can not be selected:
 - The provided selector ".TextContent_textContent__ToW2S" has no match in the web page at 'https://opentermsarchive.org/en/privacy-policy'
      at extractFromHTML (file:///Users/michiel/gh/tosdr/tosdr-declarations/node_modules/@opentermsarchive/engine/src/archivist/extract/index.js:75:11)
      at extract (file:///Users/michiel/gh/tosdr/tosdr-declarations/node_modules/@opentermsarchive/engine/src/archivist/extract/index.js:36:10)
      at Context.checkSelector (file:///Users/michiel/gh/tosdr/tosdr-declarations/node_modules/@opentermsarchive/engine/scripts/declarations/validate/index.mocha.js:127:47)
      at process.processImmediate (node:internal/timers:478:21)

It seems to work when I change the selector in the documented example from ".TextContent_textContent__ToW2S" to ".textcontent"

Maybe the reason that npx ota track did not report the same error as npx ota validate is that it doesn't have the "selector matches an element in the source document" test?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions