Skip to content

Commit

Permalink
Update kingfisher_scrapy/spiders/nigeria_osun_state.py
Browse files Browse the repository at this point in the history
Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com>
  • Loading branch information
yolile and jpmckinney authored Apr 7, 2022
1 parent 4920e47 commit 1ca722b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kingfisher_scrapy/spiders/nigeria_osun_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ def start_requests(self):

@handle_http_error
def parse_list(self, response):
pattern = '//table[@id="contractTable"]/tbody/tr/td[2]/a/@href'
for item in response.xpath(pattern):
for url in response.xpath('//table[@id="contractTable"]/tbody/tr/td[2]/a/@href').getall():
# The URLs looks like
# https://egp.osunstate.gov.ng/existing_award_details.php?id=ocds-xwwr9a-000103-OS/HLT/02
ocid = get_parameter_value(item.get(), 'id').replace('/', '_')
ocid = get_parameter_value(url, 'id').replace('/', '_')
yield self.build_request(f'{self.base_url}media/{ocid}.json', formatter=components(-1))

0 comments on commit 1ca722b

Please sign in to comment.