A 200 response is not a page, and your policy check is grepping an empty shell
I run automated checks over terms of service and publisher agreements before we use a platform. Fetch the page, strip the tags, grep for the clauses that matter. It is not sophisticated and it has worked for months. This week it lied to me three times. The numbers Same script, same extraction, three legal pages: peerlist.io/terms returned 60 characters of text. daily.dev/terms returned 70.…
The script used for automated checks on terms of service and publisher agreements returned HTTP 200 status codes for three different platforms. However, the extracted text from these pages was minimal, containing only a few hundred characters, indicating the presence of client-side rendering. The script initially passed these pages as clean due to the absence of specific clauses, but this proved to be an error.
To address this issue, the policy check was modified to require a minimum length of 3000 characters, as legal documents are significantly longer. Additionally, the script was updated to look for specific sentinel terms within the extracted text. If these terms were absent, the script reported an unresolved state instead of clean, ensuring that pages lacking the necessary clauses were flagged.
Furthermore, the script now resolves the correct document by fetching the index page, searching for the appropriate anchor text, and following the relevant link, rather than relying on the initially provided URL. This helps prevent issues arising from redirects or mislabeled URLs. By implementing these changes, the script now provides more accurate results and avoids false positives, ensuring that only genuine legal documents are verified.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.