I keep getting an Index Error whenever I try to crawl wg-gesucht. The message is:
flathunter\flathunter\crawl_wggesucht.py", line 40, in extract_data
rooms = re.findall(r'\d Zimmer', details_array[0])[0][:1]
IndexError: list index out of range
The problem seems to be that it cannot handle an empty list, i.e. there are no numbers with "Zimmer". I did a quick fix and it seems to be working for me now like this:
rooms_tmp = re.findall(r'\d Zimmer', details_array[0])
if not rooms_tmp:
rooms = 0
else:
rooms = rooms_tmp[0][:1]
Hi,
I keep getting an Index Error whenever I try to crawl wg-gesucht. The message is:
The problem seems to be that it cannot handle an empty list, i.e. there are no numbers with "Zimmer". I did a quick fix and it seems to be working for me now like this: