Repository: alltheplaces/alltheplaces

Issue:
Spider signet_jewelers is broken
During the global build at 2021-07-14-14-42-22, spider **signet_jewelers** failed with **2353 features** and **6 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/logs/signet_jewelers.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/signet_jewelers.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/signet_jewelers.geojson))


Discussion:
During the global build at 2021-08-04-14-42-45, spider **signet_jewelers** failed with **1902 features** and **5 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-08-04-14-42-45/logs/signet_jewelers.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-08-04-14-42-45/output/signet_jewelers.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-08-04-14-42-45/output/signet_jewelers.geojson))
During the global build at 2021-09-22-14-42-27, spider **signet_jewelers** failed with **1901 features** and **5 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-09-22-14-42-27/logs/signet_jewelers.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-09-22-14-42-27/output/signet_jewelers.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-09-22-14-42-27/output/signet_jewelers.geojson))

Resolving patch:
diff --git a/locations/spiders/signet_jewelers.py b/locations/spiders/signet_jewelers.py
--- a/locations/spiders/signet_jewelers.py
+++ b/locations/spiders/signet_jewelers.py
@@ -56,29 +56,38 @@ def parse_cities(self, response):
 
     def parse(self, response):
         script = " ".join(response.xpath('//*[@id="js-store-details"]/div/script/text()').extract())
-        data = re.search(r'storeInformation\s=\s((?s).*)', script).groups()[0]
-        data = data.replace(";", '')
-        data = eval(data)
-
-        if data["region"] in SignetJewelersSpider.ca_prov:
-            country = 'CA'
-        else:
-            country = 'US'
-
-        properties = {
-            'ref': data["name"],
-            'name': data["displayName"],
-            'addr_full': data["line1"],
-            'city': data["town"],
-            'state': data["region"],
-            'postcode': data["postalCode"],
-            'country': country,
-            'lat': data["latitude"],
-            'lon': data["longitude"],
-            'phone': data["phone"],
-            'website': response.url,
-            'brand': re.search(r'www.(\w+)', response.url)[1],
-        }
+        data = None
+
+        if re.search(r'storeInformation\s=\s((?s).*)', script) is not None:
+            data = re.search(r'storeInformation\s=\s((?s).*)', script).groups()
+
+        properties = {}
+
+        if data is not None:
+            if len(data) > 0:
+                data = data[0]
+            data = data.replace(";", '')
+            data = eval(data)
+
+            if data["region"] in SignetJewelersSpider.ca_prov:
+                country = 'CA'
+            else:
+                country = 'US'
+
+            properties = {
+                'ref': data["name"],
+                'name': data["displayName"],
+                'addr_full': data["line1"],
+                'city': data["town"],
+                'state': data["region"],
+                'postcode': data["postalCode"],
+                'country': country,
+                'lat': data["latitude"],
+                'lon': data["longitude"],
+                'phone': data["phone"],
+                'website': response.url,
+                'brand': re.search(r'www.(\w+)', response.url)[1],
+            }
 
         yield GeojsonPointItem(**properties)
 


Test patch: