We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Spider pricerite is broken
During the global build at 2021-05-26-14-42-23, spider **pricerite** failed with **0 features** and **2 errors**.

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

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `locations/spiders/pricerite.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 import json
3 import re
4 
5 import scrapy
6 
7 from locations.items import GeojsonPointItem
8 from locations.hours import OpeningHours
9 
10 
11 class PriceRiteSpider(scrapy.Spider):
12     name = "pricerite"
13     item_attributes = { 'brand': "PriceRite" }
14     allowed_domains = ["priceritesupermarkets.com"]
15 
16     start_urls = (
17         "https://www.priceritesupermarkets.com/locations/",
18     )
19 
20     def parse(self, response):
21         script = response.xpath('//script[contains(text(), "var stores")]').extract_first()
22         stores = json.loads(re.search(r'var stores = (.*?);', script).groups()[0])
23 
24         for store in stores:
25             properties = {
26                 "ref": store["storeNumber"],
27                 "name": store["name"],
28                 "lat": store["latitude"],
29                 "lon": store["longitude"],
30                 "addr_full": store["address1"],
31                 "city": store["city"],
32                 "state": store["state"],
33                 "postcode": store["zipCode"],
34             }
35 
36             yield GeojsonPointItem(**properties)
37 
38
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/locations/spiders/pricerite.py b/locations/spiders/pricerite.py
--- a/locations/spiders/pricerite.py
+++ b/locations/spiders/pricerite.py
@@ -5,32 +5,36 @@
 import scrapy
 
 from locations.items import GeojsonPointItem
-from locations.hours import OpeningHours
 
 
 class PriceRiteSpider(scrapy.Spider):
     name = "pricerite"
     item_attributes = { 'brand': "PriceRite" }
-    allowed_domains = ["priceritesupermarkets.com"]
+    allowed_domains = ["priceritemarketplace.com"]
 
     start_urls = (
-        "https://www.priceritesupermarkets.com/locations/",
+        "https://www.priceritemarketplace.com/",
     )
 
     def parse(self, response):
-        script = response.xpath('//script[contains(text(), "var stores")]').extract_first()
-        stores = json.loads(re.search(r'var stores = (.*?);', script).groups()[0])
+        script = response.xpath('//script[contains(text(), "__PRELOADED_STATE__")]/text()').extract_first()
+        script = script[script.index('{'):]
+        stores = json.loads(script)['stores']['availablePlanningStores']['items']
 
         for store in stores:
+            ref = store["retailerStoreId"]
             properties = {
-                "ref": store["storeNumber"],
+                "ref": ref,
+                "website": f"https://www.priceritemarketplace.com/sm/planning/rsid/{ref}",
                 "name": store["name"],
-                "lat": store["latitude"],
-                "lon": store["longitude"],
-                "addr_full": store["address1"],
+                "lat": store["location"]["latitude"],
+                "lon": store["location"]["longitude"],
+                "addr_full": store["addressLine1"],
                 "city": store["city"],
-                "state": store["state"],
-                "postcode": store["zipCode"],
+                "state": store["countyProvinceState"],
+                "postcode": store["postCode"],
+                "phone": store["phone"],
+                "opening_hours": store["openingHours"],
             }
 
             yield GeojsonPointItem(**properties)

{"golden_diff": "diff --git a/locations/spiders/pricerite.py b/locations/spiders/pricerite.py\n--- a/locations/spiders/pricerite.py\n+++ b/locations/spiders/pricerite.py\n@@ -5,32 +5,36 @@\n import scrapy\n \n from locations.items import GeojsonPointItem\n-from locations.hours import OpeningHours\n \n \n class PriceRiteSpider(scrapy.Spider):\n     name = \"pricerite\"\n     item_attributes = { 'brand': \"PriceRite\" }\n-    allowed_domains = [\"priceritesupermarkets.com\"]\n+    allowed_domains = [\"priceritemarketplace.com\"]\n \n     start_urls = (\n-        \"https://www.priceritesupermarkets.com/locations/\",\n+        \"https://www.priceritemarketplace.com/\",\n     )\n \n     def parse(self, response):\n-        script = response.xpath('//script[contains(text(), \"var stores\")]').extract_first()\n-        stores = json.loads(re.search(r'var stores = (.*?);', script).groups()[0])\n+        script = response.xpath('//script[contains(text(), \"__PRELOADED_STATE__\")]/text()').extract_first()\n+        script = script[script.index('{'):]\n+        stores = json.loads(script)['stores']['availablePlanningStores']['items']\n \n         for store in stores:\n+            ref = store[\"retailerStoreId\"]\n             properties = {\n-                \"ref\": store[\"storeNumber\"],\n+                \"ref\": ref,\n+                \"website\": f\"https://www.priceritemarketplace.com/sm/planning/rsid/{ref}\",\n                 \"name\": store[\"name\"],\n-                \"lat\": store[\"latitude\"],\n-                \"lon\": store[\"longitude\"],\n-                \"addr_full\": store[\"address1\"],\n+                \"lat\": store[\"location\"][\"latitude\"],\n+                \"lon\": store[\"location\"][\"longitude\"],\n+                \"addr_full\": store[\"addressLine1\"],\n                 \"city\": store[\"city\"],\n-                \"state\": store[\"state\"],\n-                \"postcode\": store[\"zipCode\"],\n+                \"state\": store[\"countyProvinceState\"],\n+                \"postcode\": store[\"postCode\"],\n+                \"phone\": store[\"phone\"],\n+                \"opening_hours\": store[\"openingHours\"],\n             }\n \n             yield GeojsonPointItem(**properties)\n", "issue": "Spider pricerite is broken\nDuring the global build at 2021-05-26-14-42-23, spider **pricerite** failed with **0 features** and **2 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/logs/pricerite.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/pricerite.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/pricerite.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport json\nimport re\n\nimport scrapy\n\nfrom locations.items import GeojsonPointItem\nfrom locations.hours import OpeningHours\n\n\nclass PriceRiteSpider(scrapy.Spider):\n    name = \"pricerite\"\n    item_attributes = { 'brand': \"PriceRite\" }\n    allowed_domains = [\"priceritesupermarkets.com\"]\n\n    start_urls = (\n        \"https://www.priceritesupermarkets.com/locations/\",\n    )\n\n    def parse(self, response):\n        script = response.xpath('//script[contains(text(), \"var stores\")]').extract_first()\n        stores = json.loads(re.search(r'var stores = (.*?);', script).groups()[0])\n\n        for store in stores:\n            properties = {\n                \"ref\": store[\"storeNumber\"],\n                \"name\": store[\"name\"],\n                \"lat\": store[\"latitude\"],\n                \"lon\": store[\"longitude\"],\n                \"addr_full\": store[\"address1\"],\n                \"city\": store[\"city\"],\n                \"state\": store[\"state\"],\n                \"postcode\": store[\"zipCode\"],\n            }\n\n            yield GeojsonPointItem(**properties)\n\n", "path": "locations/spiders/pricerite.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nimport json\nimport re\n\nimport scrapy\n\nfrom locations.items import GeojsonPointItem\n\n\nclass PriceRiteSpider(scrapy.Spider):\n    name = \"pricerite\"\n    item_attributes = { 'brand': \"PriceRite\" }\n    allowed_domains = [\"priceritemarketplace.com\"]\n\n    start_urls = (\n        \"https://www.priceritemarketplace.com/\",\n    )\n\n    def parse(self, response):\n        script = response.xpath('//script[contains(text(), \"__PRELOADED_STATE__\")]/text()').extract_first()\n        script = script[script.index('{'):]\n        stores = json.loads(script)['stores']['availablePlanningStores']['items']\n\n        for store in stores:\n            ref = store[\"retailerStoreId\"]\n            properties = {\n                \"ref\": ref,\n                \"website\": f\"https://www.priceritemarketplace.com/sm/planning/rsid/{ref}\",\n                \"name\": store[\"name\"],\n                \"lat\": store[\"location\"][\"latitude\"],\n                \"lon\": store[\"location\"][\"longitude\"],\n                \"addr_full\": store[\"addressLine1\"],\n                \"city\": store[\"city\"],\n                \"state\": store[\"countyProvinceState\"],\n                \"postcode\": store[\"postCode\"],\n                \"phone\": store[\"phone\"],\n                \"opening_hours\": store[\"openingHours\"],\n            }\n\n            yield GeojsonPointItem(**properties)\n\n", "path": "locations/spiders/pricerite.py"}]}