This script ensures that your predetermined query is sent to you as soon as it is published on the internet.
A simple cron job configuration, say terminal:
crontab -e
Add a new line to set a job like follow command to the bottom line:
*/30 * * * * /usr/bin/python3 <path_to_googlescan.py>
(This job will run googlescan.py 1 time in 30 minutes.)
You should turn on less secure apps setting for your google account to connect your email with this script.
And using 2-factor authentication will cause problem connecting to your gmail account.