Path: blob/master/Advertools/Advertools_Check_status_code_and_Send_notifications.ipynb
2973 views
Advertools - Check status code and Send report by email
Tags: #advertools #website #analyze #audit #seo #status_code #response_headers #naas #notification #scheduler
Author: Florent Ravenel
Last update: 2023-07-31 (Created: 2023-07-20)
Description: This notebook runs an automated status code checker with response headers using the HTTP HEAD
method and send a report by email.
NB:
Bulk and concurrent checking of status codes for a known list of URLs
Get all available response headers from all URLs
Set speed, number of concurent request and various other crawling options
Does NOT download the full HTML of a page, saving a lot of time, energy, and resources, and enabling an extreemely fast and light process
References:
Input
Install libraries
If running it on naas, run the code below to uninstall (bug) and install the libraries
Import libraries
Setup Variables
url_list
: List of URLs to check the status codesemail_to
: List of emails to send the reportcron
: We use CRON tasks to schedule notebooks, find the syntax you need to on: https://crontab.guru/subject
: Email subjectoutput_file
: The path to the file for saving the output. It has to be in the '.jl' format. Note that new lines to the file are 'appended' to the end and the file is not overwritten while crawling.output_ko
: Status KO in csv to be attached in report