Skip to content

feat(crawlers)!: Fetch robots.txt with the cookies of a session - #2586

Draft
Mantisus wants to merge 4 commits into
apify:v2from
Mantisus:robots-txt-session
Draft

Mantisus wants to merge 4 commits into
apify:v2from
Mantisus:robots-txt-session

Conversation

@Mantisus

@Mantisus Mantisus commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Description

The crawler fetches robots.txt with a session from its session pool, so the request sends the cookies of the session, and the cookies of the response are saved to it, even with save_response_cookies=False. Sites with bot protection can answer a request without them with 4xx or 5xx, and that status alone then decides whether all URLs of the origin are allowed or disallowed.

send_request with a session and without proxy_info sends the request through the proxy of the session, and ignores TLS errors when that proxy sets ignore_tls_errors. A passed proxy_info still takes precedence.

Issues

Testing

  • Unit tests for the session proxy in send_request of every HTTP client and for the robots.txt cookies reaching the session.

✍️ Drafted by Claude Code

@Mantisus
Mantisus marked this pull request as draft December 3, 2026 21:09
@Mantisus Mantisus self-assigned this Dec 3, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 3, 2026

This branch has not been deployed

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

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant