We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Spider lees_famous_recipe is broken
During the global build at 2021-10-20-14-42-48, spider **lees_famous_recipe** failed with **0 features** and **130 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/logs/lees_famous_recipe.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/lees_famous_recipe.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/lees_famous_recipe.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/lees_famous_recipe.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 import scrapy
3 from locations.items import GeojsonPointItem
4 import re
5 
6 daysKey = {
7                 'Monday': 'Mo', 'Tuesday': 'Tu', 'Wednesday': 'We', 'Thursday': 'Th',
8                 'Friday': 'Fr', 'Saturday': 'Sa', 'Sunday': 'Su'
9 }
10 
11 
12 class LeesFamousRecipeSpider(scrapy.Spider):
13     name = "lees_famous_recipe"
14     item_attributes = { 'brand': "Lee's Famous Recipe Chicken" }
15     allowed_domains = ["www.leesfamousrecipe.com"]
16     start_urls = (
17         'https://www.leesfamousrecipe.com/locations/all',
18     )
19 
20     def parse_phone(self, phone):
21         phone = phone.replace('.','')
22         phone = phone.replace(')','')
23         phone = phone.replace('(','')
24         phone = phone.replace('_','')
25         phone = phone.replace('-','')
26         phone = phone.replace('+','')
27         phone = phone.replace(' ','')
28         return phone
29 
30     def store_hours(self, hours):
31         try:
32             days = hours.split(': ')[0].strip()
33             if('-' in days):
34                 startDay = daysKey[days.split('-')[0]]
35                 endDay = daysKey[days.split('-')[1]]
36                 dayOutput = startDay + "-" + endDay
37             else:
38                 dayOutput = daysKey[days]
39 
40             bothHours = hours.split(': ')[1].replace(' ','')
41             openHours = bothHours.split("-")[0]
42             closeHours = bothHours.split("-")[1]
43 
44             if("am" in openHours):
45                 openHours = openHours.replace("am","")
46                 if(":" in openHours):
47                     openH = openHours.split(":")[0]
48                     openM = openHours.split(":")[1]
49                 else:
50                     openH = openHours
51                     openM = "00"
52                 openHours = openH + ":" + openM
53 
54             if("pm" in openHours):
55                 openHours = openHours.replace("pm","")
56                 if(":" in openHours):
57                     openH = openHours.split(":")[0]
58                     openM = openHours.split(":")[1]
59                 else:
60                     openH = openHours
61                     openM = "00"
62                 openH = str(int(openH) + 12)
63                 openHours = openH + ":" + openM
64 
65             if("am" in closeHours):
66                 closeHours = closeHours.replace("am","")
67                 if(":" in closeHours):
68                     closeH = closeHours.split(":")[0]
69                     closeM = closeHours.split(":")[1]
70                 else:
71                     closeH = closeHours
72                     closeM = "00"
73                 closeHours = closeH + ":" + closeM
74 
75             if("pm" in closeHours):
76                 closeHours = closeHours.replace("pm","")
77                 if(":" in closeHours):
78                     closeH = closeHours.split(":")[0]
79                     closeM = closeHours.split(":")[1]
80                 else:
81                     closeH = closeHours
82                     closeM = "00"
83                 closeH = str(int(closeH) + 12)
84                 closeHours = closeH + ":" + closeM
85             return dayOutput +' '+ openHours.replace(' ','') + "-" + closeHours + ';'
86         except KeyError:
87             return ""
88 
89     def parse(self, response):
90         if("https://www.leesfamousrecipe.com/locations/all" == response.url):
91             for match in response.xpath("//div[contains(@class,'field-content')]/a/@href"):
92                 request = scrapy.Request(match.extract())
93                 yield request
94         else:
95             nameString = response.xpath("//h1[@class='node-title']/text()").extract_first().strip()
96             shortString = response.xpath("//h1[@class='node-title']/small/text()").extract_first()
97             if shortString is None:
98                 shortString = ""
99             nameString = nameString + " " + shortString
100             nameString = nameString.strip()
101 
102             scriptBody = response.xpath("//script[@type='text/javascript' and contains(.,'latitude')]/text()").extract_first()
103             latString = re.findall("latitude\":\"(.*?)\"", scriptBody)[0]
104             lonString = re.findall("longitude\":\"(.*?)\"", scriptBody)[0]
105 
106             openingHoursString = ""
107             firstHourBlock = response.xpath("//div[contains(@class,'field-name-field-hours-summer')]/div/div/p/br/parent::p/text()")
108             for hourLine in firstHourBlock:
109                 openingHoursString = openingHoursString +' '+self.store_hours(hourLine.extract())
110             openingHoursString = openingHoursString.strip(';').strip()
111 
112 
113             if("british-columbia" in response.url):
114                 countryString = "CA"
115                 stateString = "BC"
116             else:
117                 countryString = "US"
118                 mapUrl = response.xpath("//div[contains(@class,'map-link')]/div/a/@href").extract_first()
119                 stateString = re.findall(r'(?<=\+)(.*?)(?=\+)', mapUrl)[len(re.findall(r'(?<=\+)(.*?)(?=\+)', mapUrl)) - 2].strip().replace('%2C','')
120 
121             yield GeojsonPointItem(
122                 ref=nameString,
123                 addr_full=response.xpath("//div[@class='street-address']/text()").extract_first().strip(),
124                 city=response.xpath("//div[@class='city-state-zip']/span[@class='locality']/text()").extract_first().strip(),
125                 opening_hours=openingHoursString,
126                 state=stateString,
127                 postcode=response.xpath("//div[@class='city-state-zip']/span[@class='postal-code']/text()").extract_first().strip(),
128                 phone=self.parse_phone(response.xpath("//div[contains(@class,'field-name-field-phone')]/div/div/text()").extract_first().strip()),
129                 country = countryString,
130                 lat=float(latString),
131                 lon=float(lonString),
132             )
133 
134
```
--- 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/lees_famous_recipe.py b/locations/spiders/lees_famous_recipe.py
--- a/locations/spiders/lees_famous_recipe.py
+++ b/locations/spiders/lees_famous_recipe.py
@@ -83,7 +83,7 @@
                 closeH = str(int(closeH) + 12)
                 closeHours = closeH + ":" + closeM
             return dayOutput +' '+ openHours.replace(' ','') + "-" + closeHours + ';'
-        except KeyError:
+        except (KeyError, IndexError):
             return ""
 
     def parse(self, response):
@@ -99,9 +99,8 @@
             nameString = nameString + " " + shortString
             nameString = nameString.strip()
 
-            scriptBody = response.xpath("//script[@type='text/javascript' and contains(.,'latitude')]/text()").extract_first()
-            latString = re.findall("latitude\":\"(.*?)\"", scriptBody)[0]
-            lonString = re.findall("longitude\":\"(.*?)\"", scriptBody)[0]
+            googleMapSrc = response.xpath("//*[@id='block-system-main']/div/div/iframe").extract_first()
+            [latString, lonString] = re.findall("center=(.*?)\"", googleMapSrc)[0].split(',')
 
             openingHoursString = ""
             firstHourBlock = response.xpath("//div[contains(@class,'field-name-field-hours-summer')]/div/div/p/br/parent::p/text()")
@@ -116,7 +115,7 @@
             else:
                 countryString = "US"
                 mapUrl = response.xpath("//div[contains(@class,'map-link')]/div/a/@href").extract_first()
-                stateString = re.findall(r'(?<=\+)(.*?)(?=\+)', mapUrl)[len(re.findall(r'(?<=\+)(.*?)(?=\+)', mapUrl)) - 2].strip().replace('%2C','')
+                stateString = response.xpath("//div[contains(@class,'adr')]/div[2]/span[2]/text()").extract_first()
 
             yield GeojsonPointItem(
                 ref=nameString,
@@ -125,7 +124,7 @@
                 opening_hours=openingHoursString,
                 state=stateString,
                 postcode=response.xpath("//div[@class='city-state-zip']/span[@class='postal-code']/text()").extract_first().strip(),
-                phone=self.parse_phone(response.xpath("//div[contains(@class,'field-name-field-phone')]/div/div/text()").extract_first().strip()),
+                phone=self.parse_phone(response.xpath("//div[contains(@class,'adr')]/div[3]/text()").extract_first().strip()),
                 country = countryString,
                 lat=float(latString),
                 lon=float(lonString),

{"golden_diff": "diff --git a/locations/spiders/lees_famous_recipe.py b/locations/spiders/lees_famous_recipe.py\n--- a/locations/spiders/lees_famous_recipe.py\n+++ b/locations/spiders/lees_famous_recipe.py\n@@ -83,7 +83,7 @@\n                 closeH = str(int(closeH) + 12)\n                 closeHours = closeH + \":\" + closeM\n             return dayOutput +' '+ openHours.replace(' ','') + \"-\" + closeHours + ';'\n-        except KeyError:\n+        except (KeyError, IndexError):\n             return \"\"\n \n     def parse(self, response):\n@@ -99,9 +99,8 @@\n             nameString = nameString + \" \" + shortString\n             nameString = nameString.strip()\n \n-            scriptBody = response.xpath(\"//script[@type='text/javascript' and contains(.,'latitude')]/text()\").extract_first()\n-            latString = re.findall(\"latitude\\\":\\\"(.*?)\\\"\", scriptBody)[0]\n-            lonString = re.findall(\"longitude\\\":\\\"(.*?)\\\"\", scriptBody)[0]\n+            googleMapSrc = response.xpath(\"//*[@id='block-system-main']/div/div/iframe\").extract_first()\n+            [latString, lonString] = re.findall(\"center=(.*?)\\\"\", googleMapSrc)[0].split(',')\n \n             openingHoursString = \"\"\n             firstHourBlock = response.xpath(\"//div[contains(@class,'field-name-field-hours-summer')]/div/div/p/br/parent::p/text()\")\n@@ -116,7 +115,7 @@\n             else:\n                 countryString = \"US\"\n                 mapUrl = response.xpath(\"//div[contains(@class,'map-link')]/div/a/@href\").extract_first()\n-                stateString = re.findall(r'(?<=\\+)(.*?)(?=\\+)', mapUrl)[len(re.findall(r'(?<=\\+)(.*?)(?=\\+)', mapUrl)) - 2].strip().replace('%2C','')\n+                stateString = response.xpath(\"//div[contains(@class,'adr')]/div[2]/span[2]/text()\").extract_first()\n \n             yield GeojsonPointItem(\n                 ref=nameString,\n@@ -125,7 +124,7 @@\n                 opening_hours=openingHoursString,\n                 state=stateString,\n                 postcode=response.xpath(\"//div[@class='city-state-zip']/span[@class='postal-code']/text()\").extract_first().strip(),\n-                phone=self.parse_phone(response.xpath(\"//div[contains(@class,'field-name-field-phone')]/div/div/text()\").extract_first().strip()),\n+                phone=self.parse_phone(response.xpath(\"//div[contains(@class,'adr')]/div[3]/text()\").extract_first().strip()),\n                 country = countryString,\n                 lat=float(latString),\n                 lon=float(lonString),\n", "issue": "Spider lees_famous_recipe is broken\nDuring the global build at 2021-10-20-14-42-48, spider **lees_famous_recipe** failed with **0 features** and **130 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/logs/lees_famous_recipe.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/lees_famous_recipe.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/lees_famous_recipe.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport scrapy\nfrom locations.items import GeojsonPointItem\nimport re\n\ndaysKey = {\n                'Monday': 'Mo', 'Tuesday': 'Tu', 'Wednesday': 'We', 'Thursday': 'Th',\n                'Friday': 'Fr', 'Saturday': 'Sa', 'Sunday': 'Su'\n}\n\n\nclass LeesFamousRecipeSpider(scrapy.Spider):\n    name = \"lees_famous_recipe\"\n    item_attributes = { 'brand': \"Lee's Famous Recipe Chicken\" }\n    allowed_domains = [\"www.leesfamousrecipe.com\"]\n    start_urls = (\n        'https://www.leesfamousrecipe.com/locations/all',\n    )\n\n    def parse_phone(self, phone):\n        phone = phone.replace('.','')\n        phone = phone.replace(')','')\n        phone = phone.replace('(','')\n        phone = phone.replace('_','')\n        phone = phone.replace('-','')\n        phone = phone.replace('+','')\n        phone = phone.replace(' ','')\n        return phone\n\n    def store_hours(self, hours):\n        try:\n            days = hours.split(': ')[0].strip()\n            if('-' in days):\n                startDay = daysKey[days.split('-')[0]]\n                endDay = daysKey[days.split('-')[1]]\n                dayOutput = startDay + \"-\" + endDay\n            else:\n                dayOutput = daysKey[days]\n\n            bothHours = hours.split(': ')[1].replace(' ','')\n            openHours = bothHours.split(\"-\")[0]\n            closeHours = bothHours.split(\"-\")[1]\n\n            if(\"am\" in openHours):\n                openHours = openHours.replace(\"am\",\"\")\n                if(\":\" in openHours):\n                    openH = openHours.split(\":\")[0]\n                    openM = openHours.split(\":\")[1]\n                else:\n                    openH = openHours\n                    openM = \"00\"\n                openHours = openH + \":\" + openM\n\n            if(\"pm\" in openHours):\n                openHours = openHours.replace(\"pm\",\"\")\n                if(\":\" in openHours):\n                    openH = openHours.split(\":\")[0]\n                    openM = openHours.split(\":\")[1]\n                else:\n                    openH = openHours\n                    openM = \"00\"\n                openH = str(int(openH) + 12)\n                openHours = openH + \":\" + openM\n\n            if(\"am\" in closeHours):\n                closeHours = closeHours.replace(\"am\",\"\")\n                if(\":\" in closeHours):\n                    closeH = closeHours.split(\":\")[0]\n                    closeM = closeHours.split(\":\")[1]\n                else:\n                    closeH = closeHours\n                    closeM = \"00\"\n                closeHours = closeH + \":\" + closeM\n\n            if(\"pm\" in closeHours):\n                closeHours = closeHours.replace(\"pm\",\"\")\n                if(\":\" in closeHours):\n                    closeH = closeHours.split(\":\")[0]\n                    closeM = closeHours.split(\":\")[1]\n                else:\n                    closeH = closeHours\n                    closeM = \"00\"\n                closeH = str(int(closeH) + 12)\n                closeHours = closeH + \":\" + closeM\n            return dayOutput +' '+ openHours.replace(' ','') + \"-\" + closeHours + ';'\n        except KeyError:\n            return \"\"\n\n    def parse(self, response):\n        if(\"https://www.leesfamousrecipe.com/locations/all\" == response.url):\n            for match in response.xpath(\"//div[contains(@class,'field-content')]/a/@href\"):\n                request = scrapy.Request(match.extract())\n                yield request\n        else:\n            nameString = response.xpath(\"//h1[@class='node-title']/text()\").extract_first().strip()\n            shortString = response.xpath(\"//h1[@class='node-title']/small/text()\").extract_first()\n            if shortString is None:\n                shortString = \"\"\n            nameString = nameString + \" \" + shortString\n            nameString = nameString.strip()\n\n            scriptBody = response.xpath(\"//script[@type='text/javascript' and contains(.,'latitude')]/text()\").extract_first()\n            latString = re.findall(\"latitude\\\":\\\"(.*?)\\\"\", scriptBody)[0]\n            lonString = re.findall(\"longitude\\\":\\\"(.*?)\\\"\", scriptBody)[0]\n\n            openingHoursString = \"\"\n            firstHourBlock = response.xpath(\"//div[contains(@class,'field-name-field-hours-summer')]/div/div/p/br/parent::p/text()\")\n            for hourLine in firstHourBlock:\n                openingHoursString = openingHoursString +' '+self.store_hours(hourLine.extract())\n            openingHoursString = openingHoursString.strip(';').strip()\n\n\n            if(\"british-columbia\" in response.url):\n                countryString = \"CA\"\n                stateString = \"BC\"\n            else:\n                countryString = \"US\"\n                mapUrl = response.xpath(\"//div[contains(@class,'map-link')]/div/a/@href\").extract_first()\n                stateString = re.findall(r'(?<=\\+)(.*?)(?=\\+)', mapUrl)[len(re.findall(r'(?<=\\+)(.*?)(?=\\+)', mapUrl)) - 2].strip().replace('%2C','')\n\n            yield GeojsonPointItem(\n                ref=nameString,\n                addr_full=response.xpath(\"//div[@class='street-address']/text()\").extract_first().strip(),\n                city=response.xpath(\"//div[@class='city-state-zip']/span[@class='locality']/text()\").extract_first().strip(),\n                opening_hours=openingHoursString,\n                state=stateString,\n                postcode=response.xpath(\"//div[@class='city-state-zip']/span[@class='postal-code']/text()\").extract_first().strip(),\n                phone=self.parse_phone(response.xpath(\"//div[contains(@class,'field-name-field-phone')]/div/div/text()\").extract_first().strip()),\n                country = countryString,\n                lat=float(latString),\n                lon=float(lonString),\n            )\n\n", "path": "locations/spiders/lees_famous_recipe.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nimport scrapy\nfrom locations.items import GeojsonPointItem\nimport re\n\ndaysKey = {\n                'Monday': 'Mo', 'Tuesday': 'Tu', 'Wednesday': 'We', 'Thursday': 'Th',\n                'Friday': 'Fr', 'Saturday': 'Sa', 'Sunday': 'Su'\n}\n\n\nclass LeesFamousRecipeSpider(scrapy.Spider):\n    name = \"lees_famous_recipe\"\n    item_attributes = { 'brand': \"Lee's Famous Recipe Chicken\" }\n    allowed_domains = [\"www.leesfamousrecipe.com\"]\n    start_urls = (\n        'https://www.leesfamousrecipe.com/locations/all',\n    )\n\n    def parse_phone(self, phone):\n        phone = phone.replace('.','')\n        phone = phone.replace(')','')\n        phone = phone.replace('(','')\n        phone = phone.replace('_','')\n        phone = phone.replace('-','')\n        phone = phone.replace('+','')\n        phone = phone.replace(' ','')\n        return phone\n\n    def store_hours(self, hours):\n        try:\n            days = hours.split(': ')[0].strip()\n            if('-' in days):\n                startDay = daysKey[days.split('-')[0]]\n                endDay = daysKey[days.split('-')[1]]\n                dayOutput = startDay + \"-\" + endDay\n            else:\n                dayOutput = daysKey[days]\n\n            bothHours = hours.split(': ')[1].replace(' ','')\n            openHours = bothHours.split(\"-\")[0]\n            closeHours = bothHours.split(\"-\")[1]\n\n            if(\"am\" in openHours):\n                openHours = openHours.replace(\"am\",\"\")\n                if(\":\" in openHours):\n                    openH = openHours.split(\":\")[0]\n                    openM = openHours.split(\":\")[1]\n                else:\n                    openH = openHours\n                    openM = \"00\"\n                openHours = openH + \":\" + openM\n\n            if(\"pm\" in openHours):\n                openHours = openHours.replace(\"pm\",\"\")\n                if(\":\" in openHours):\n                    openH = openHours.split(\":\")[0]\n                    openM = openHours.split(\":\")[1]\n                else:\n                    openH = openHours\n                    openM = \"00\"\n                openH = str(int(openH) + 12)\n                openHours = openH + \":\" + openM\n\n            if(\"am\" in closeHours):\n                closeHours = closeHours.replace(\"am\",\"\")\n                if(\":\" in closeHours):\n                    closeH = closeHours.split(\":\")[0]\n                    closeM = closeHours.split(\":\")[1]\n                else:\n                    closeH = closeHours\n                    closeM = \"00\"\n                closeHours = closeH + \":\" + closeM\n\n            if(\"pm\" in closeHours):\n                closeHours = closeHours.replace(\"pm\",\"\")\n                if(\":\" in closeHours):\n                    closeH = closeHours.split(\":\")[0]\n                    closeM = closeHours.split(\":\")[1]\n                else:\n                    closeH = closeHours\n                    closeM = \"00\"\n                closeH = str(int(closeH) + 12)\n                closeHours = closeH + \":\" + closeM\n            return dayOutput +' '+ openHours.replace(' ','') + \"-\" + closeHours + ';'\n        except (KeyError, IndexError):\n            return \"\"\n\n    def parse(self, response):\n        if(\"https://www.leesfamousrecipe.com/locations/all\" == response.url):\n            for match in response.xpath(\"//div[contains(@class,'field-content')]/a/@href\"):\n                request = scrapy.Request(match.extract())\n                yield request\n        else:\n            nameString = response.xpath(\"//h1[@class='node-title']/text()\").extract_first().strip()\n            shortString = response.xpath(\"//h1[@class='node-title']/small/text()\").extract_first()\n            if shortString is None:\n                shortString = \"\"\n            nameString = nameString + \" \" + shortString\n            nameString = nameString.strip()\n\n            googleMapSrc = response.xpath(\"//*[@id='block-system-main']/div/div/iframe\").extract_first()\n            [latString, lonString] = re.findall(\"center=(.*?)\\\"\", googleMapSrc)[0].split(',')\n\n            openingHoursString = \"\"\n            firstHourBlock = response.xpath(\"//div[contains(@class,'field-name-field-hours-summer')]/div/div/p/br/parent::p/text()\")\n            for hourLine in firstHourBlock:\n                openingHoursString = openingHoursString +' '+self.store_hours(hourLine.extract())\n            openingHoursString = openingHoursString.strip(';').strip()\n\n\n            if(\"british-columbia\" in response.url):\n                countryString = \"CA\"\n                stateString = \"BC\"\n            else:\n                countryString = \"US\"\n                mapUrl = response.xpath(\"//div[contains(@class,'map-link')]/div/a/@href\").extract_first()\n                stateString = response.xpath(\"//div[contains(@class,'adr')]/div[2]/span[2]/text()\").extract_first()\n\n            yield GeojsonPointItem(\n                ref=nameString,\n                addr_full=response.xpath(\"//div[@class='street-address']/text()\").extract_first().strip(),\n                city=response.xpath(\"//div[@class='city-state-zip']/span[@class='locality']/text()\").extract_first().strip(),\n                opening_hours=openingHoursString,\n                state=stateString,\n                postcode=response.xpath(\"//div[@class='city-state-zip']/span[@class='postal-code']/text()\").extract_first().strip(),\n                phone=self.parse_phone(response.xpath(\"//div[contains(@class,'adr')]/div[3]/text()\").extract_first().strip()),\n                country = countryString,\n                lat=float(latString),\n                lon=float(lonString),\n            )\n\n", "path": "locations/spiders/lees_famous_recipe.py"}]}