can only join an iterable error on shell scrapy on python scraping
Question:
I have a simply code for scrapy but i got an error when there is None, see my code below, how can fix it
In [428]: ”.join(response.css(".prdd-price-first::text").get()).strip()
TypeError: can only join an iterable
Answers:
Iterable means your expression to be a list. So you can do something like:
''.join([ x.get().strip() for x in response.css(".prdd-price-first::text")])
I have a simply code for scrapy but i got an error when there is None, see my code below, how can fix it
In [428]: ”.join(response.css(".prdd-price-first::text").get()).strip()
TypeError: can only join an iterable
Iterable means your expression to be a list. So you can do something like:
''.join([ x.get().strip() for x in response.css(".prdd-price-first::text")])