AttributeError: 'int' object has no attribute 'rindex' <p><strong>Setup</strong></p> <p>I'm using Scrapy 0.24.4 and <a href="https://github.com/knockrentals/scrapy-elasticsearch" rel="nofollow">Scrapy-ElasticSearch 0.5</a> to scrape a website and store the results in an elasticsearch instance I have running.</p> <p>I've used <a href="http://blog.florian-hopf.de/2014/07/scrapy-and-elasticsearch.html" rel="nofollow">this blog post</a> to set it all up, with the minor modification that I documented <a href="http://blog.florian-hopf.de/2014/07/scrapy-and-elasticsearch.html?showComment=1413801748670#c1092074214387731109" rel="nofollow">here</a>.</p> <p><em>settings.py</em></p> <pre><code>BOT_NAME = 'blah' SPIDER_MODULES = ['blah.spiders'] NEWSPIDER_MODULE = 'blah.spiders' ITEM_PIPELINES = [ 'scrapyelasticsearch.scrapyelasticsearch.ElasticSearchPipeline', 100 ] ELASTICSEARCH_SERVER = 'localhost' ELASTICSEARCH_PORT = 9200 ELASTICSEARCH_INDEX = 'scrapy' ELASTICSEARCH_TYPE = 'items' </code></pre> <p><strong>Problem</strong></p> <p>If I run the following command to scrape a website:</p> <pre><code>scrapy crawl wiki -o wiki.json </code></pre> <p>With ITEM_PIPELINES commented out - then it works correctly and exports all results to a wiki.json file.</p> <p>With ITEM_PIPELINES uncommented (e.g. set to enable piping results to elasticsearch) - I get the following error:</p> <pre><code>File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/misc.py", line 34, in load_object dot = path.rindex('.') AttributeError: 'int' object has no attribute 'rindex' </code></pre> <p><strong>Notes</strong></p> <ul> <li>May or may not be relevant. I actually had to change my local copy of ElasticSearchPipeline python file to comment out <a href="https://github.com/knockrentals/scrapy-elasticsearch/blob/master/scrapyelasticsearch/scrapyelasticsearch.py#L39" rel="nofollow">this block</a> which was causing syntax errors at the point at which it was indexing using uniq_id.</li> </ul> <p>Any help hugely appreciated.</p>