aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-01-13 11:22:16 +0100
committerneodarz <neodarz@neodarz.net>2019-01-13 11:22:16 +0100
commitf0b4712c897ee35f2d79cf0408f480c2c0bb41da (patch)
treed180494b88350861cfef3ecfddb655aca4363086 /app.py
parentc01eb0e3220924c24aabc3ccd282f89f9ed9cb3e (diff)
downloadkhanindexer-f0b4712c897ee35f2d79cf0408f480c2c0bb41da.tar.xz
khanindexer-f0b4712c897ee35f2d79cf0408f480c2c0bb41da.zip
Save all crawled datas in database
Diffstat (limited to 'app.py')
-rw-r--r--app.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/app.py b/app.py
index 2a80507..281f932 100644
--- a/app.py
+++ b/app.py
@@ -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()