Crawler Blocked by a Bot Protection
Many websites protect themselves against automated access with a bot management, for example from Fastly, Cloudflare, Imperva, Vercel, Akamai, AWS WAF or DataDome. Such a protection also blocks the LoyJoy crawler, so the pages of a website source cannot be indexed. This page shows how to recognise the block and how the website operator lets the crawler through.
Symptom
- The import of a new website or sitemap stops after a few minutes without any indexed page.
- The URLs of the source fail with the message
Failed as the website blocks automated access with the bot protection of <vendor>.If the vendor cannot be recognised, the message ends withwith a bot protection. - Under Knowledge > Crawling, the section Messages explains that the crawling of the source was stopped because the website blocks automated access. The same entry is in the Manager Log of the tenant settings.
- The email at the end of the import says that no page could be indexed.
LoyJoy stops a source after 3 blocked requests if none of its pages could be indexed. This way the crawler does not keep a blocked website busy for days. A source that already has indexed pages is not stopped; its blocked URLs are retried as usual.
Cause
The website operator blocks automated access on purpose. LoyJoy respects this decision and does not evade bot protections. The block can only be lifted by the operator of the website, which is usually your own IT department or your web agency.
Solution A: Secret HTTP Header (recommended)
The operator creates a rule in the bot management that lets requests with a secret HTTP header through. You enter the same header in LoyJoy.
- Agree on a header name and a long, random value, for example the name
X-LoyJoy-Crawlerand a value generated by a password manager. - The website operator creates a rule in the bot management or web application firewall (WAF) of the website, along these lines:
- If the request header
X-LoyJoy-Crawlerequals<secret value> - then skip the bot protection (allow the request).
- If the request header
- In the LoyJoy Manager, open the website source and enter the header name and value under Custom HTTP headers.
The crawler sends the header only to the domain of the source, never to other websites. The value is hidden in the Manager. Keep the value secret and change it if it becomes known.
This solution is recommended because the rule only applies to requests that know the secret value, independent of the network the crawler uses.
Solution B: Allow the IP Address of the Crawler
If the bot management cannot check headers, the website operator can allow the IP address from which the LoyJoy crawler accesses websites:
67.207.78.217
The rule then lets every request from this IP address through the bot protection.
Afterwards: Index the Source Again
After the website operator has set up the rule, index the source again with the re-index icon in the source list. Under Knowledge > Crawling you can follow the import live. If the URLs still fail with the bot protection message, ask the website operator to check whether the rule applies to the domain of the source.