I am extracting content with the help of scrapy into an array. Each element has the unwanted characters ": " inside which I would like to remove as efficient as possible.
v = response.xpath('//div[@id="tab"]/text()').extract()
>>> v
['Marke:', 'Modell:']
>>> for i in v : re.sub(r'[^\w]', '', i)
...
'Marke'
'Modell'
Now that seems to work, but how can I retain the result?
In my code, v
hasn't changed:
>>> v
['Marke:', 'Modell:']