Itinerary Spider

class scraper.spiders.itinerary_spider.ItinerarySpider(username, dob, chatID, uncropped=False, *args, **kwargs)

Take screenshot of http://report.aldel.org/parent/itinenary_attendance_report.php and send it to the user via scraper.pipelines.ItineraryScreenshotPipeline

Parameters:InitSpider (Spider) – Base Spider with initialization facilities
name = 'itinerary'
allowed_domains = ['report.aldel.org']
login_page = 'http://report.aldel.org/parent_page.php'
start_urls = ['http://report.aldel.org/parent/itinenary_attendance_report.php']
init_request()

This function is called before crawling starts.

login(response)

Generate a login request.

check_login_response(response)

Check the response returned by a login request to see if we are successfully logged in.

parse(response)

Send a SplashRequest and forward the response to parse_result()

parse_result(response)

Downloads and saves the attendance report in files/<Student_ID>_itinerary.png format.

scraper.spiders.itinerary_spider.scrape_itinerary(username, dob, chatID, uncropped=False)

Run the spider multiple times, without hitting ReactorNotRestartable exception. Forks own process.

Parameters:
  • username (str) – student’s PID (format: XXXNameXXXX) where X - integers
  • dob (str) – User’s Date of Birth
  • chatID (str) – 9-Digit unique user ID
  • uncropped (bool) – Whether the user wants full report or for last 7-8 days