Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 error systematically #21

Open
fredtostaky opened this issue Apr 11, 2023 · 2 comments
Open

403 error systematically #21

fredtostaky opened this issue Apr 11, 2023 · 2 comments

Comments

@fredtostaky
Copy link

  • trainline version: 0.1.2
  • Python version: Python 3.7.12
  • Operating System: Ubuntu 22.04

Description

import trainline

results = trainline.search(
departure_station="Toulouse",
arrival_station="Bordeaux",
from_date="15/05/2023 08:00",
to_date="15/05/2023 21:00")

print(results.csv())

What I Did


ConnectionError: Status code 403 for url https://www.trainline.eu/api/v5_1/search
{"url":"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAlKNr1QJizNQAmE2fxQ==&cid=8xF~oUzPNL-oYo39IbiOCm6bsa07Cczk449-C5qcIlqEYLyQRKMnipNjrzunDh7j4fAy0_YdSq~qhEPSd0w73WxlGhLCy~qtybii6zkYYvkzpIUBELc3A9GvOjVIaOp&referer=HTTPS%3A%2F%2Fwww.trainline.eu%2Fapi%2Fv5_1%2Fsearch&hash=E1950F58FF4C3B67C237DE42A4D080&t=fe&s=35668&e=6418b8f16dabeec967beb95265b8b63962e2c4166ca4b41593d3e90c3995fb34"}

@said026
Copy link

said026 commented May 2, 2023

Hello,
The error is due to the anti-bot protection from Datatome. which protects Trainline's APIs from scraping.

@supercairos
Copy link

Is there any work-around this protection ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants