A Chinese team building a web scraper reads robots.txt as the first layer of a source’s access rules, not as a permission slip on its own. The practical reading has three parts: which paths and user agents the file restricts, what pacing or crawl hints it provides, and how those restrictions reconcile with the source’s broader platform terms of service. A robots file that appears permissive does not override a terms clause that forbids systematic collection, and a disallowed path should not be worked around by other request paths. This article explains how a careful team parses the file, where its limits sit, and how diff detection keeps the compliance posture current as the file and the site change. Buyers should treat robots compliance as a baseline the pipeline can demonstrate, while the terms review remains the legal judgment their own counsel confirms.
What the file actually declares, path by path
A robots file groups rules under user-agent blocks, each covering a named crawler or the wildcard agent that matches all others. Within a block, allow and disallow paths say which URL paths the crawler should not request. A disallow entry applies to that path and its subpaths unless a more specific allow entry overrides it; wildcard patterns and path prefixes are interpreted according to the file’s own syntax, and ambiguous entries should be treated conservatively rather than resolved in favor of access. A careful implementation fetches the file per source at the start of a run, parses the relevant user-agent block, and filters the URL queue against the matching rules before any request leaves the queue.
Other entries carry operational hints rather than hard restrictions. A crawl-delay entry suggests a minimum interval between requests for that agent; sitemap entries list where the source publishes its index; some files note policy URLs or notification contacts. These hints should be recorded in the source’s rule profile and honored where the source expects them. The implementation should also record the file’s fetched date and its effective rules, so that later questions about what was permitted on a given day can be answered from a stored record rather than memory.
A worked example makes the parsing concrete. Assume a file opens a wildcard block allowing the public catalog path, disallowing the internal account route and the administrative area, and setting a delay hint. The relevant comparison checks each queued URL against the longest matching rule: a catalog detail page under the allowed path remains queued, an account-preferences route under the disallowed prefix is removed, and a deeper nested admin path follows its parent disallow. Ambiguous entries, such as a partial prefix that could match several routes, should be logged for manual review rather than resolved in the most permissive reading. The parsed rule profile should list, per source, the allowed roots, disallowed prefixes, agent block used, delay hint, and any sitemap reference, so a later operator can see the compliance basis without re-fetching the file.
How user-agent blocks affect a scraping pipeline
Choosing which agent identity the pipeline identifies as is a compliance decision, not a technical convenience. A crawler that sends a descriptive, identifiable agent string with a contact or project identifier is traceable and reachable if the source needs to make contact; impersonating a known search crawler to inherit its rules is not a legitimate reading of the file, and hiding the agent’s identity makes any later complaint harder to resolve. The pipeline’s declared agent should match the block the rules are applied against, and the team should check whether the source maintains separate rules for its own announced crawlers versus general automated access.
When a source publishes a specific agent block for a named bot, that block’s rules take precedence over the wildcard block for that identity; a generic wildcard allowance does not clear a specific disallow. For a custom pipeline with its own declared agent, the wildcard block is the relevant reference, and the team should apply its restrictions in the conservative reading. Any request that would fall under a disallowed path—whether a listing page, an internal endpoint, an export route, or an administrative area—should stay out of the queue, and the compliance check should run on queued URLs before they are scheduled rather than after a request already fails.
The gap between robots rules and platform terms of service
The robots file is a technical convention maintained by web operators; the terms and conditions, developer agreements, and data licenses attached to a source carry separate contractual expectations. In practice this means four distinct situations a team should separate. A source that allows both in the file and in the terms is open to the proposed collection subject to other rules. A source whose file allows a path but whose terms forbid systematic or commercial reuse requires the terms question to be resolved before collection continues. A source whose file disallows a path but whose terms permit a specific partner arrangement still depends on that agreement being in place. And a source that restricts access in both should be left alone unless an official license or API channel exists.
Buyers should not let a vendor treat an empty or permissive robots file as evidence that collection is legally cleared. The platform terms of service review covers access, reuse, attribution, and commercial republication, and it may restrict data the robots file never mentions. The risk categories and the buyer-side review steps are laid out in the scraping and platform terms risk assessment, and the robots parse should be one input to that review rather than its substitute. Where an official API or data feed exists, that channel’s agreement usually sets the governing rules even when public pages are reachable.
Two details often decide a practical dispute. First, public availability in a browser does not imply a license to republish or resell the records, and the terms that govern reuse are usually separate from those that govern reading. Second, a source that sells its own data product or sells access to its listings often treats systematic extraction as a competing product, and its terms may say so even when the public pages are reachable without a login. The vendor should record which side of each distinction a source falls on, and the buyer’s counsel should confirm the conclusion for any commercial or redistributed use.
Pacing hints and what polite collection still requires
Crawl-delay and similar hints set a starting interval, but polite collection also responds to the source’s actual response behavior: slow replies, temporary overload responses, and throttling signals should push the schedule back rather than the pipeline holding a fixed interval regardless of conditions. Per-source pacing, backoff after slow or error responses, and a daily volume ceiling belong in the runbook, with the robots hint used as the baseline the interval starts from. The network layer used to distribute requests is ordinary infrastructure, sized to the pacing plan; it should not be presented as a way to route around disallowed paths or access controls.
Queue design supports this behavior naturally: work is organized per source, failed pages sit in a retry bucket with backoff, and a source that repeatedly fails can be paused without blocking others. The retry and failure-budget model behind this is specified in the reliability and retries article, and the robots-derived interval should feed the per-source pacing configuration there. Buyers should ask vendors what interval each source uses, where the number came from, and how the schedule adapts when responses slow down.
Diff detection: watching the file and the site for rule changes
Robots files change over time, and so do page structures and terms. Diff detection applied to the robots file means comparing each fetched version against the stored previous one: new disallow paths, removed allow entries, changed crawl delays, and switched user-agent blocks are flagged as rule changes that require review before collection continues. A saved baseline from onboarding gives the first comparison point; without it, a rule change looks like ordinary variation. The same field-level comparison used for listing prices and statuses applies here, with untracked decorative page variation excluded from the change signal.
Beyond the file, the pipeline should watch for signs that access expectations have shifted: new login gates, relocated export routes, changed terms pages, or sources that began serving restricted content to automated agents. When a rule change appears, the correct response is to pause the affected path, review the new rule against the terms, and resume only after the change is assessed; detection should not be tuned to suppress alerts that indicate restriction changes. The monitoring design for these signals pairs with the change-monitoring tools covered in the program’s compliance section, where logs of rule versions and review decisions support an audit trail.
What buyers should verify in the vendor’s implementation
Before kickoff, ask the vendor to show how robots rules are fetched and parsed per source, which agent identity the pipeline declares, how disallowed paths are filtered from the queue, and what interval each source starts from. Request a stored record of the fetched file, its effective rules, and the fetch date, and ask how changes to the file are detected and reviewed. Confirm that the terms review is documented separately from the robots check, with access and reuse permission recorded per source. A team that can demonstrate these steps has built compliance into the collection loop; a team that treats robots.txt as a yes/no checkbox has left the actual access judgment undocumented, which is the risk the buyer would inherit after launch.
Leave a Reply