-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (32 loc) · 1.37 KB
/
main.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
# scraper used to scrape marriage data's from tnreginet.gov.in used for educational purposes
import concurrent.futures
import csv
from itertools import repeat
from myScraper import myscraper
####### SETUP #######
mar_type = 'TMR1' # Options: 'TMR1' 'HMR' 'TMR1a' 'SPL' 'SPLO' 'CMR'
####### SETUP #######
project_path = '/Users/username/Downloads/TNregi_Scrape'
logs_path = f'{project_path}logs/'
# LOAD place list from file
if mar_type == 'CMR':
pass
else:
with open('placeList.txt', 'r', encoding="utf-8") as f:
for line in csv.reader(f):
print(' \n file reading done ! \n')
place_list = line
print(line)
print('\n PLACE list successfully loaded..!! \n')
print('\n \n \n')
if __name__ == '__main__':
if mar_type != 'CMR':
for yr in (2016, 2017, 2015):
with concurrent.futures.ThreadPoolExecutor(max_workers=15) as executor:
print('Creating ThreadPoolExecutor...')
start_scrape = executor.map(myscraper, repeat(mar_type), place_list, repeat(yr))
else:
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
year = (2015, 2016, 2017)
print('Creating ThreadPoolExecutor...')
start_scrape = executor.map(myscraper, repeat(mar_type), repeat('CHURCH'), year)