Skip to content

Commit

Permalink
uk_fts: temp replace python 1e9999 values
Browse files Browse the repository at this point in the history
Signed-off-by: Yohanna Lisnichuk <yohanitalisnichuk@gmail.com>
  • Loading branch information
yolile committed Jan 15, 2021
1 parent 5963d7a commit ebb7b5c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kingfisher_scrapy/spiders/uk_fts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import scrapy

from kingfisher_scrapy.base_spider import LinksSpider
from kingfisher_scrapy.util import parameters
from kingfisher_scrapy.util import parameters, handle_http_error


class UKFTS(LinksSpider):
Expand Down Expand Up @@ -32,3 +32,12 @@ def start_requests(self):
url = f'{url}?updatedFrom={self.from_date}&updatedTo={self.until_date}'

yield scrapy.Request(url, meta={'file_name': 'start.json'}, headers={'Accept': 'application/json'})

@handle_http_error
def parse(self, response):
data = response.text
# TODO: temporary fix for https://github.com/open-contracting/kingfisher-process/issues/323, remove when it's
# solved in kingfisher process
data = data.replace('1e9999', '9999999')
response = response.replace(body=data)
yield from super().parse(response)

0 comments on commit ebb7b5c

Please sign in to comment.