forked from EricSchles/traffickingGrab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrape.py
53 lines (36 loc) · 1.08 KB
/
scrape.py
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
import glob
import os
from subprocess import *
import time
to_fix_places = glob.glob("*")
places = []
for i in to_fix_places:
if not ".py" in i:
if not ".txt" in i:
if not "Base" in i:
places.append(i)
for place in places:
os.chdir(place)
os.getcwd()
#most of this is being careful
#call(['rm','recursive_scrape.py'])
#call(['cp','../Base_Code/recursive_scrape.py','../'+place+'/recursive_scrape.py'])
# if os.path.exists("results"):
# os.chdir("results")
# curr_dir = glob.glob("*")
# if curr_dir != []:
# os.chdir("../../")
# continue
# os.chdir("../")
# os.rmdir("results")
# if os.path.exists("recursive_top_level"):
# os.chdir("recursive_top_level")
# files_to_delete = glob.glob("*")
# for i in files_to_delete:
# os.remove(i)
# os.chdir("../")
# os.rmdir("recursive_top_level")
call(['python','recursive_scrape.py'])
os.getcwd()
os.chdir("../")
time.sleep(3)