I try to scrape som data from an apartment listing site.
I want to use the price to calculate. So I need to store it as numbers. But it's written like text on the website like this: 5 670 money/month
I want to remove all the characters and spaces, Then make it an integer to save in my db.
I tried regular expression, but get this error.
TypeError: expected string or bytes-like object
This is a element I collect the price from.
<p class="info-price">399 euro per month</p>
I get the price with xpath like this
p = response.xpath('//p[@class="info-price"]/text()').extract()
And the output when I collect name of object and price would be like this
{'object': ['North West End 24'], 'price': ['399\xa0euro\xa0per\xa0month']}
How and when should I convert it?