I am working with the web scraping framework Scrapy and I am a bit of a noob when it comes to python. So I am wondering how do I iterate over all of the scraped items which
Assuming you would like to strip the values of yourDict creating a new dict called newDict:
yourDict
dict
newDict
newDict = dict(zip(yourDict.keys(), [v.strip() if isinstance(v,str) else v for v in yourDict.values()]))
This code can handle multi-type values, so will avoid stripping int, float, etc.
int
float