Skip to content

Commit

Permalink
spiders(nigeria_ebonyi_state): apply suggestion from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravf95 committed Mar 31, 2022
1 parent 3129bed commit 5cb85d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kingfisher_scrapy/spiders/nigeria_ebonyi_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ class NigeriaEbonyiState(PeriodicSpider):

@handle_http_error
def parse(self, response):
'''
The JSON data sometimes contains unescaped tab characters within strings.
'''
data = response.text
# Remove tab characters to prevent invalid JSON errors within strings
data = data.replace('\t', '')
data = data.replace('\t', ' ')
response = response.replace(body=data)
yield from super().parse(response)

0 comments on commit 5cb85d8

Please sign in to comment.