-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
20 lines (17 loc) · 770 Bytes
/
main.py
File metadata and controls
20 lines (17 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from date_and_time import get_date_time
from helpers import write_json_txt
from new_logging import log
from parser_avito import get_global_result
from sqlite import get_urls
if __name__ == '__main__':
try:
log.info('-----------------------------------------------------------------------------------------------')
log.info('Starting parsing ' + str(get_date_time()))
tasks = []
tasks += get_urls()
global_result = get_global_result(tasks)
write_json_txt(global_result, 'data.json')
log.info('Parsing Success ' + str(get_date_time()))
log.info('-----------------------------------------------------------------------------------------------')
except Exception as e:
log.exception(str(e))