-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrawl.sh
executable file
·22 lines (22 loc) · 878 Bytes
/
crawl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
cd adstxt
if [ ! -d "csv" ]
then
echo "Adding directory csv in `pwd`"
mkdir -p csv
echo "Added directory successfully."
fi
scrapy crawl -a fileName=$1 adstxt
lastStatusCode=$(echo $?)
if [ $lastStatusCode -ne 0 ]
then
echo "******************************************************************************"
echo "Something went wrong here."
echo "******************************************************************************"
else
echo "******************************************************************************"
echo "All scraped csv files are in `pwd`/csv"
echo "******************************************************************************"
echo "If there were urls that could not be scraped, refer log file: `pwd`/scrapy.log"
echo "******************************************************************************"
fi