diff options
author | neodarz <neodarz@neodarz.net> | 2019-01-13 11:22:16 +0100 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-01-13 11:22:16 +0100 |
commit | f0b4712c897ee35f2d79cf0408f480c2c0bb41da (patch) | |
tree | d180494b88350861cfef3ecfddb655aca4363086 /app.py | |
parent | c01eb0e3220924c24aabc3ccd282f89f9ed9cb3e (diff) | |
download | khanindexer-f0b4712c897ee35f2d79cf0408f480c2c0bb41da.tar.xz khanindexer-f0b4712c897ee35f2d79cf0408f480c2c0bb41da.zip |
Save all crawled datas in database
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,8 +1,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() |