aboutsummaryrefslogtreecommitdiff
path: root/app.py
blob: 281f9329279ec003f90aee57b6d3c7b26ee01ef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings

from crawler.neodarznet.spiders.scrape import ScrapSpider

from database.models import Page, db
import config

process = CrawlerProcess(get_project_settings())

def main():
    db.create_tables([Page])

    process.crawl(ScrapSpider)
    process.start()

if __name__ == '__main__':
    main()