Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Jan 14, 2025
1 parent 781b861 commit 9217f2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scrapers/pr/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,18 @@ def scrape_bill(self, chamber, session, url):
html = self.s.get(url, headers=headers, verify=False).text
page = lxml.html.fromstring(html)

page_header_elems = page.xpath('//main//div[contains(@class, "items-center")]/h1/text()')
page_header_elems = page.xpath(
'//main//div[contains(@class, "items-center")]/h1/text()'
)
if len(page_header_elems) > 0:
page_header_text = page_header_elems[0].strip()
bill_id = re.findall(r"[A-Z]{2}\d{4}", page_header_text)[0]
else:
self.logger.error(f"Bill found with no bill identifier at {url}")

bill_title_elems = page.xpath('//span/strong[text()="Título:"]/../following-sibling::span')
bill_title_elems = page.xpath(
'//span/strong[text()="Título:"]/../following-sibling::span'
)
if len(bill_title_elems) > 0:
title = bill_title_elems[0].text_content().strip()
else:
Expand Down

0 comments on commit 9217f2d

Please sign in to comment.