Skip to main content

Scraper for ACIS based bus time sites

Project description

Bus Scraper allows you to scrape bus times and information from ACIS powered bus time sites (like the Oxfordshire, South Yorkshire, Bristol, and Kent ones). If they change the markup of their pages, it might break.

#!/usr/bin/env python

import busscraper

busscraper.stop(“37035419”, “tsy”)

[{‘minutes_to_departure’: 0, ‘destination’: u’Rotherham ’, ‘service’: u’220 ’}, {‘minutes_to_departure’: 30, ‘destination’: u’Doncaster ’, ‘service’: u’222 ’}, {‘minutes_to_departure’: 30, ‘destination’: u’Rotherham ’, ‘service’: u’220 ’}, {‘minutes_to_departure’: 0, ‘destination’: u’Rotherham ’, ‘service’: u’229 ’}]

busscraper.postcode(“s637tg”, “tsy”)

[{‘distance’: 107, ‘stop_name’: u’Pope Pius School’, ‘stop_id’: u’37035419’}, {‘distance’: 168, ‘stop_name’: u’Pope Pius School’, ‘stop_id’: u’37035385’}]

busscraper.service(“2”, “5”, “Blackbird+Leys”, “oxfordshire”, “35”)

[{‘stop_name’: u’Oxford Rail Stn R2’, ‘stop_id’: u’69326565&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Frideswide Sq R7’, ‘stop_id’: u’340002070R7&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’New Road D1’, ‘stop_id’: u’340000868D1&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Castle Street M1’, ‘stop_id’: u’340000007M1&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Speedwell St S2’, ‘stop_id’: u’340001989S2&pscode=5&dest=&textonly=1’}, {‘stop_name’: u”St Aldate’s G4”, ‘stop_id’: u’69326475&pscode=5&dest=&textonly=1’}, {‘stop_name’: u”Queen’s Lane K1”, ‘stop_id’: u’340001992K1&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’The Plain’, ‘stop_id’: u’340001126TYN&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’James Street’, ‘stop_id’: u’340001199PEM&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Manzil Way’, ‘stop_id’: u’340001198OUT&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Magdalen Road’, ‘stop_id’: u’340001195OPP&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Howard Street’, ‘stop_id’: u’340001197CNR&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Shelley Road’, ‘stop_id’: u’69323639&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Marsh Road’, ‘stop_id’: u’340001200OPH&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Clive Road’, ‘stop_id’: u’340001201OPP&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Original Swan PH’, ‘stop_id’: u’340001257BTW&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Templars Square’, ‘stop_id’: u’69324978&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Barns Road’, ‘stop_id’: u’340001251OPB&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Kersington Crescent’, ‘stop_id’: u’340001225CNR&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Sandy Lane West’, ‘stop_id’: u’340001230ERB&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Sandy Lane’, ‘stop_id’: u’69325292&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Wingate Close’, ‘stop_id’: u’340001234CNR&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Longlands Road’, ‘stop_id’: u’340001229CNR&pscode=5&dest=&textonly=1’}, {‘stop_name’: u’Pegasus Court’, ‘stop_id’: u’69325284&pscode=5&dest=&textonly=1’}]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BusScraper-0.2.2.tar.gz (15.7 kB view details)

Uploaded Source

File details

Details for the file BusScraper-0.2.2.tar.gz.

File metadata

  • Download URL: BusScraper-0.2.2.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for BusScraper-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3113801ce6dd36a3ca9703d258e5efe99c2ef8c2b3ac0fbd357492511a715c29
MD5 76c8c7dc9857c3ceec243b14a46beb6b
BLAKE2b-256 4f76230f6b916a4031a47f6292db559e7933dc1afb61d1d6783567951b5c4cfc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page