Skip to content

Robots.txt respect should be ON by default #614

Open

Description

@mvl22

Robots.txt is ignored by default, as far as I can see:
https://github.com/gocolly/colly/blob/master/colly.go#L348-L354

This is disrespectful to site owners. There is no good reason this should be ignored by default:

  • If scraping a site you control, then you already know whether you want a scraper to ignore the robots.txt directives, and can set the flag accordingly.
  • If scraping someone else's site, then you should actively have to choose to ignore their request not to capture material. People specifically go to the effort of putting directives into the robots.txt file (which a well-understood standard) for good reasons, and there is an expectation that legitimate bot usage will respect the directives.

We've just had one of your software users fall into our spamtrap, so their activity is now banned across every site on our server. I doubt that's what they actually wanted, simply because they failed to respect our robots.txt file, probably inadvertently.

Activity

  1. StantonMatt commented on Jun 3, 2026

    @StantonMatt

    There is an open PR for this now: #821.

    I checked that branch locally against current master. The focused robots/default tests pass and the diff is whitespace-clean, but the full suite still needs one test update before the PR is merge-ready: queue/TestQueue assumes the old ignore-robots default, so its test server closes /robots.txt and the queued requests never reach OnRequest. Adding colly.IgnoreRobotsTxt() to that test collector made the focused queue test pass locally.

    So the behavior direction matches this issue, but #821 still needs the test/docs cleanup called out there before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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