Comments (7)
@vreen what version of Python do you use?
from scrapy-elasticsearch.
@vreen I pushed a new build, please give it a test and let me know (0aec4cc)
from scrapy-elasticsearch.
@jayzeng I am using Python 3.5.2
Your commit fixes the 'ListType' issue but heads to the next one:
Traceback (most recent call last):
File "/home/spl/Code/python_env/myenv/lib/python3.5/site-packages/twisted/internet/defer.py", line 587, in _runCallbacks
current.result = callback(current.result, _args, *_kw)
File "/home/spl/Code/python_env/myenv/lib/python3.5/site-packages/scrapyelasticsearch/scrapyelasticsearch.py", line 112, in process_item
self.index_item(item)
File "/home/spl/Code/python_env/myenv/lib/python3.5/site-packages/scrapyelasticsearch/scrapyelasticsearch.py", line 94, in index_item
item_id = hashlib.sha1(unique_key).hexdigest()
TypeError: Unicode-objects must be encoded before hashing
from scrapy-elasticsearch.
@vreen never tested it w/ Python 3, I will make whatever changes required to make it compatible. Stay tuned
from scrapy-elasticsearch.
@vreen pushed the fix 4c35d75 and cut a new release (0.8.5), give it a test and let me know if it works.
from scrapy-elasticsearch.
@jayzeng Line 94 has to be modified accordingly:
item_id = hashlib.sha1(unique_key.encode('utf-8')).hexdigest()
After that, this nice Pipeline works with Python 3.5!
Thanks for having an eye on this.
from scrapy-elasticsearch.
@vreen sorry I linked the wrong commit for the fix, here it is 8aa92f6, it is essentially the same as what you did, except it is added in the get_unique_key(), which is more appricate. Either way, I pushed my change to pypi, feel free to pull the latest.
Have fun :)
from scrapy-elasticsearch.
Related Issues (20)
- What does 'ELASTICSEARCH_UNIQ_KEY' do? HOT 2
- Unable to post to ssl endpoint with custom CA HOT 7
- Content-Type required, Elasticsearch 6.x HOT 1
- Text field always gets ignore_above keyword HOT 1
- Unique key is tuple if using items HOT 1
- Removal of _type requirement
- BulkIndexError HOT 1
- Missing header information for ElasticSearch 6.2 HOT 2
- got an unexpected keyword argument 'headers' HOT 3
- is it possible update item if this item with id exists? HOT 2
- Suggest making item_id = hashlib.sha1(unique_key).hexdigest() optional
- Scrapy logging show UnicodeDecodeError HOT 1
- deleted
- Suggestion of setting '_index', '_source' and other parameters directly in parser
- ElasticsearchDeprecationWarning: [types removal] Specifying types in bulk requests is deprecated.
- Please support Scrapy 2.4.1 HOT 1
- I downloaded the package but I still get a module not found.
- Cluster name and Cluster node field not available
- elasticsearch.helpers.BulkIndexError after long time of scraping HOT 5
- Doesn't support scrapy dataclass item
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrapy-elasticsearch.