-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker.py
More file actions
31 lines (24 loc) · 900 Bytes
/
worker.py
File metadata and controls
31 lines (24 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
usage='''
👾 Automated Screaming Frog Worker
🔍 Usage:
worker.py crawl <site>
worker.py (-h | --help)
💡 Examples:
▶️ worker.py crawl "https://searchon.it/"
▶️ worker.py crawl "https://searchon.it/" config "some.seospiderconfig"
▶️ worker.py -h Print this message
👀 Options:
-h, --help
'''
from datetime import date, timedelta
import subprocess
from docopt import docopt
args = docopt(usage)
today = date.today()
cmd = 'screamingfrogseospider --crawl ' + args['<site>'] + ' --headless --config testconfig.seospiderconfig --export-tabs "Internal:All"'
cmd += f" && mv internal_all.csv internal_all_{today.day}{today.month}{today.year}.csv"
try:
proc = subprocess.run(cmd, shell=True)
except subprocess.CalledProcessError:
print('[SF] Exception raised while running Screaming Frog')