-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.py
50 lines (42 loc) · 1.17 KB
/
parser.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
import threading
import os
import sys
import time
from avitoParser import AvitoParser
from vkParser import VkParser
if __name__ == "__main__":
os.system("clear")
noutsParams = {
"city": "sevastopol",
"subject": "НОУТБУКИ СЕВАСТОПОЛЬ",
"maxPrice": 20000,
"minPrice": 2700,
"url": "https://www.avito.ru/sevastopol/noutbuki"
}
tvParams = {
"city": "sevastopol",
"subject": "ТЕЛЕВИЗОРЫ СЕВАСТОПОЛЬ",
"maxPrice": 25000,
"minPrice": 0,
"url": "https://www.avito.ru/sevastopol/audio_i_video/televizory_i_proektory"
}
monitorParams = {
"city": "sevastopol",
"subject": "МОНИТОРЫ СЕВАСТОПОЛЬ",
"maxPrice": 5000,
"minPrice": 0,
"url": "https://www.avito.ru/sevastopol/tovary_dlya_kompyutera/monitory"
}
vkNoutParams = {
"prodType":"nouts",
"subject":"ВК НОУТБУКИ",
"count":15
}
lock = threading.Lock()
parsers = [AvitoParser(lock, **noutsParams), AvitoParser(lock, **tvParams), AvitoParser(lock, **monitorParams),
VkParser(lock, **vkNoutParams)]
#parsers = [VkParser(**vkNoutParams)]
for parser in parsers:
parser.start()
for parser in parsers:
parser.join()