-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_scraper.sh
More file actions
70 lines (59 loc) · 1.91 KB
/
run_scraper.sh
File metadata and controls
70 lines (59 loc) · 1.91 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# Dark Web Threat Intelligence Scraper Runner
# FOR EDUCATIONAL AND ETHICAL USE ONLY
echo ""
echo "==============================================="
echo " Dark Web Threat Intelligence Scraper"
echo "==============================================="
echo " FOR EDUCATIONAL AND ETHICAL USE ONLY"
echo "==============================================="
echo ""
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "ERROR: Python 3 is not installed"
echo "Please install Python 3.8+ and try again"
exit 1
fi
# Check Python version
python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
required_version="3.8"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "ERROR: Python 3.8+ is required (found $python_version)"
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
if [ $? -ne 0 ]; then
echo "ERROR: Failed to create virtual environment"
exit 1
fi
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Install requirements if not already installed
if [ ! -f "venv/lib/python*/site-packages/requests/__init__.py" ]; then
echo "Installing requirements..."
pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "ERROR: Failed to install requirements"
exit 1
fi
fi
# Check if config exists
if [ ! -f "config.json" ]; then
echo "ERROR: config.json not found!"
echo "Please run setup.py first or copy from config.example.json"
exit 1
fi
# Run the scraper
echo ""
echo "Starting Dark Web Threat Intelligence Scraper..."
echo "Press Ctrl+C to stop"
echo ""
python main.py
echo ""
echo "Scraper finished. Check results.csv for output."
read -p "Press Enter to continue..."