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

Asked By: crawlers

||

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")])
Answered By: Fazlul