-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner.py
More file actions
25 lines (21 loc) · 787 Bytes
/
runner.py
File metadata and controls
25 lines (21 loc) · 787 Bytes
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
import os
from os.path import join, dirname
from dotenv import load_dotenv
from scrapy.crawler import CrawlerProcess
from scrapy.settings import Settings
from jobparser import settings
from jobparser.spiders.hhru import HhruSpider
from jobparser.spiders.sjru import SjruSpider
from jobparser.spiders.instagram import InstagramSpider
do_env = join(dirname(__file__), '.env')
load_dotenv(do_env)
INST_LOGIN = os.getenv('INST_LOGIN')
INST_PWD = os.getenv('INST_PASSWORD')
if __name__ == '__main__':
crawler_setting = Settings()
crawler_setting.setmodule(settings)
process = CrawlerProcess(settings=crawler_setting)
# process.crawl(HhruSpider)
# process.crawl(SjruSpider)
process.crawl(InstagramSpider, ['geekbrains.ru'], INST_LOGIN, INST_PWD)
process.start()