I am unable to do the following:
from scrapy.selector import Selector
The error is:
File "/Desktop/KSL/KSL/spiders/spider.py", line 1, in from scrapy.selector import Selector ImportError: cannot import name Selector
It is as if LXML is not installed on my machine, but it is. Also, I thought this was a default module built into scrapy. Maybe not?
Thoughts?
Try importing HtmlXPathSelector instead.
And then use the .select() method to parse out your html. For example,
If you are following the tutorial on the Scrapy site (http://doc.scrapy.org/en/latest/intro/tutorial.html), the updated example would look like this:
Hope this helps!
I encounter the same problem. I think there is something wrong with your scrapy version.
You could type
scrapy version -v
into cmd to check the version. As far as I know, the newest version is 0.24.4 (2014.10.23). You could visit http://scrapy.org/ to find the newest.Had the same issue which was due to the way I installed scrapy (my OS is Ubuntu). I did it through
Install it from python instead. If you use Anaconda just do
If not, then
http://doc.scrapy.org/en/latest/intro/install.html