Start a new topic

## Crawler error

Hello ,


I am trying to create crawler from Kara.com but getting below error.Please view my code in attachment file and try to help.

 


Packing version bdc8ea7-testing
Deploying to Scrapy Cloud project "442308"
Deploy log last 30 lines:
    _run(args, settings)
  File "/usr/local/lib/python2.7/site-packages/sh_scrapy/crawl.py", line 103, in _run
    _run_scrapy(args, settings)
  File "/usr/local/lib/python2.7/site-packages/sh_scrapy/crawl.py", line 111, in _run_scrapy
    execute(settings=settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/cmdline.py", line 149, in execute
    cmd.crawler_process = CrawlerProcess(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/crawler.py", line 251, in __init__
    super(CrawlerProcess, self).__init__(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/crawler.py", line 137, in __init__
    self.spider_loader = _get_spider_loader(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/crawler.py", line 338, in _get_spider_loader
    return loader_cls.from_settings(settings.frozencopy())
  File "/usr/local/lib/python2.7/site-packages/scrapy/spiderloader.py", line 61, in from_settings
    return cls(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/spiderloader.py", line 25, in __init__
    self._load_all_spiders()
  File "/usr/local/lib/python2.7/site-packages/scrapy/spiderloader.py", line 47, in _load_all_spiders
    for module in walk_modules(name):
  File "/usr/local/lib/python2.7/site-packages/scrapy/utils/misc.py", line 71, in walk_modules
    submod = import_module(fullpath)
  File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/__main__.egg/books/spiders/books.py", line 20
    item["product_title"]     = product.css("h1 ::text").extract_first()
    ^
IndentationError: unexpected indent
{"message": "shub-image-info exit code: 1", "details": null, "error": "image_info_error"}

{"status": "error", "message": "Internal error"}
Deploy log location: /tmp/shub_deploy_rq_5Yl.log
Error: Deploy failed: {"status": "error", "message": "Internal error"}


Please help if any can

py
(857 Bytes)
1 Comment

Hello,


As specified by Error message "IndentationError: unexpected indent" there is error in line 20.


When I opened the code in an editor it shows as below, please correct the indentation for item["product_title"] and re-try.

 item["product_name"]     = response.css("ol.product-items > li").extract()

        item["product_title"]     = product.css("h1 ::text").extract_first()


Let us know if you face any issues.


Regards,

Thriveni

Login to post a comment