From a7bb23eb4430e6432356dce1883b896abbaf71f9 Mon Sep 17 00:00:00 2001 From: William Palin Date: Mon, 20 Nov 2023 15:02:51 -0500 Subject: [PATCH] fix(arizctapp_div_2): Tweak scraper --- juriscraper/opinions/united_states/state/arizctapp_div_2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/juriscraper/opinions/united_states/state/arizctapp_div_2.py b/juriscraper/opinions/united_states/state/arizctapp_div_2.py index 54390ef30..50c8f0ed1 100644 --- a/juriscraper/opinions/united_states/state/arizctapp_div_2.py +++ b/juriscraper/opinions/united_states/state/arizctapp_div_2.py @@ -26,7 +26,10 @@ def _process_html(self) -> None: for item in self.html.xpath(path): docket = item.xpath("./text()")[0] url = item.xpath("./@href")[0] - name = item.xpath("./following::td[1]/*/text()")[0] + names = item.xpath("./following::td[1]/*/text()") + if not names: + continue + name = names[0] # Expected: "Opinion Filed: 10/13/2021" date_string = item.xpath("./following::td[2]/text()")[0].strip() date = clean_if_py3(date_string).rsplit(":", 1)[1].strip()