We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Spider advanceautoparts is broken
During the global build at 2021-05-21-20-28-08, spider **advanceautoparts** failed with **0 features** and **405 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-05-21-20-28-08/logs/advanceautoparts.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-21-20-28-08/output/advanceautoparts.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-21-20-28-08/output/advanceautoparts.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/advanceautoparts.py`
Content:
```
1 import json
2 import re
3 
4 import scrapy
5 
6 from locations.hours import OpeningHours
7 from locations.items import GeojsonPointItem
8 
9 
10 class AdvanceautopartsSpider(scrapy.Spider):
11 
12     name = "advanceautoparts"
13     item_attributes = {"brand": "Advance Auto Parts", "brand_wikidata": "Q4686051"}
14     allowed_domains = ["stores.advanceautoparts.com"]
15     start_urls = ("https://stores.advanceautoparts.com/sitemap.xml",)
16 
17     def parse(self, response):
18         response.selector.remove_namespaces()
19         urls = response.xpath("//loc/text()").getall()
20         storeRe = re.compile(r"^https://stores.advanceautoparts.com/[^/]+/[^/]+/[^/]+$")
21         for url in urls:
22             if storeRe.fullmatch(url):
23                 yield scrapy.Request(url, callback=self.parse_store)
24 
25     def parse_hours(self, store_hours):
26         opening_hours = OpeningHours()
27 
28         for weekday in store_hours:
29             day = weekday.get("day").title()
30             for interval in weekday.get("intervals", []):
31                 open_time = str(interval.get("start"))
32                 close_time = str(interval.get("end"))
33                 opening_hours.add_range(
34                     day=day[:2],
35                     open_time=open_time,
36                     close_time=close_time,
37                     time_format="%H%M",
38                 )
39 
40         return opening_hours.as_opening_hours()
41 
42     def parse_store(self, response):
43         name = response.xpath('//h1[@itemprop="name"]/text()').extract_first()
44 
45         js = json.loads(response.xpath('//script[@class="js-map-config"]/text()').get())
46         ref = js["entities"][0]["profile"]["meta"]["id"]
47 
48         hours = response.xpath(
49             '//div[@class="c-hours-details-wrapper js-hours-table"]/@data-days'
50         ).extract_first()
51         try:
52             opening_hours = self.parse_hours(json.loads(hours))
53         except ValueError:
54             opening_hours = None
55 
56         properties = {
57             "addr_full": response.xpath(
58                 'normalize-space(//meta[@itemprop="streetAddress"]/@content)'
59             ).extract_first(),
60             "phone": response.xpath(
61                 'normalize-space(//div[@itemprop="telephone"]/text())'
62             ).extract_first(),
63             "city": response.xpath(
64                 'normalize-space(//meta[@itemprop="addressLocality"]/@content)'
65             ).extract_first(),
66             "state": response.xpath(
67                 'normalize-space(//abbr[@itemprop="addressRegion"]/text())'
68             ).extract_first(),
69             "postcode": response.xpath(
70                 'normalize-space(//span[@itemprop="postalCode"]/text())'
71             ).extract_first(),
72             "ref": ref,
73             "website": response.url,
74             "lat": response.xpath(
75                 'normalize-space(//meta[@itemprop="latitude"]/@content)'
76             ).extract_first(),
77             "lon": response.xpath(
78                 'normalize-space(//meta[@itemprop="longitude"]/@content)'
79             ).extract_first(),
80             "name": name,
81             "opening_hours": opening_hours,
82             "extras": {"shop": "car_parts"},
83         }
84         yield GeojsonPointItem(**properties)
85
```
--- 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/advanceautoparts.py b/locations/spiders/advanceautoparts.py
--- a/locations/spiders/advanceautoparts.py
+++ b/locations/spiders/advanceautoparts.py
@@ -45,38 +45,22 @@
         js = json.loads(response.xpath('//script[@class="js-map-config"]/text()').get())
         ref = js["entities"][0]["profile"]["meta"]["id"]
 
-        hours = response.xpath(
-            '//div[@class="c-hours-details-wrapper js-hours-table"]/@data-days'
-        ).extract_first()
+        hours = response.xpath('//div[@class="c-hours-details-wrapper js-hours-table"]/@data-days').extract_first()
         try:
             opening_hours = self.parse_hours(json.loads(hours))
         except ValueError:
             opening_hours = None
 
         properties = {
-            "addr_full": response.xpath(
-                'normalize-space(//meta[@itemprop="streetAddress"]/@content)'
-            ).extract_first(),
-            "phone": response.xpath(
-                'normalize-space(//div[@itemprop="telephone"]/text())'
-            ).extract_first(),
-            "city": response.xpath(
-                'normalize-space(//meta[@itemprop="addressLocality"]/@content)'
-            ).extract_first(),
-            "state": response.xpath(
-                'normalize-space(//abbr[@itemprop="addressRegion"]/text())'
-            ).extract_first(),
-            "postcode": response.xpath(
-                'normalize-space(//span[@itemprop="postalCode"]/text())'
-            ).extract_first(),
+            "addr_full": response.xpath('normalize-space(//meta[@itemprop="streetAddress"]/@content)').extract_first(),
+            "phone": response.xpath('normalize-space(//div[@itemprop="telephone"]/text())').extract_first(),
+            "city": response.xpath('normalize-space(//meta[@itemprop="addressLocality"]/@content)').extract_first(),
+            "state": response.xpath('normalize-space(//abbr[@itemprop="addressRegion"]/text())').extract_first(),
+            "postcode": response.xpath('normalize-space(//span[@itemprop="postalCode"]/text())').extract_first(),
             "ref": ref,
             "website": response.url,
-            "lat": response.xpath(
-                'normalize-space(//meta[@itemprop="latitude"]/@content)'
-            ).extract_first(),
-            "lon": response.xpath(
-                'normalize-space(//meta[@itemprop="longitude"]/@content)'
-            ).extract_first(),
+            "lat": response.xpath('normalize-space(//meta[@itemprop="latitude"]/@content)').extract_first(),
+            "lon": response.xpath('normalize-space(//meta[@itemprop="longitude"]/@content)').extract_first(),
             "name": name,
             "opening_hours": opening_hours,
             "extras": {"shop": "car_parts"},

{"golden_diff": "diff --git a/locations/spiders/advanceautoparts.py b/locations/spiders/advanceautoparts.py\n--- a/locations/spiders/advanceautoparts.py\n+++ b/locations/spiders/advanceautoparts.py\n@@ -45,38 +45,22 @@\n         js = json.loads(response.xpath('//script[@class=\"js-map-config\"]/text()').get())\n         ref = js[\"entities\"][0][\"profile\"][\"meta\"][\"id\"]\n \n-        hours = response.xpath(\n-            '//div[@class=\"c-hours-details-wrapper js-hours-table\"]/@data-days'\n-        ).extract_first()\n+        hours = response.xpath('//div[@class=\"c-hours-details-wrapper js-hours-table\"]/@data-days').extract_first()\n         try:\n             opening_hours = self.parse_hours(json.loads(hours))\n         except ValueError:\n             opening_hours = None\n \n         properties = {\n-            \"addr_full\": response.xpath(\n-                'normalize-space(//meta[@itemprop=\"streetAddress\"]/@content)'\n-            ).extract_first(),\n-            \"phone\": response.xpath(\n-                'normalize-space(//div[@itemprop=\"telephone\"]/text())'\n-            ).extract_first(),\n-            \"city\": response.xpath(\n-                'normalize-space(//meta[@itemprop=\"addressLocality\"]/@content)'\n-            ).extract_first(),\n-            \"state\": response.xpath(\n-                'normalize-space(//abbr[@itemprop=\"addressRegion\"]/text())'\n-            ).extract_first(),\n-            \"postcode\": response.xpath(\n-                'normalize-space(//span[@itemprop=\"postalCode\"]/text())'\n-            ).extract_first(),\n+            \"addr_full\": response.xpath('normalize-space(//meta[@itemprop=\"streetAddress\"]/@content)').extract_first(),\n+            \"phone\": response.xpath('normalize-space(//div[@itemprop=\"telephone\"]/text())').extract_first(),\n+            \"city\": response.xpath('normalize-space(//meta[@itemprop=\"addressLocality\"]/@content)').extract_first(),\n+            \"state\": response.xpath('normalize-space(//abbr[@itemprop=\"addressRegion\"]/text())').extract_first(),\n+            \"postcode\": response.xpath('normalize-space(//span[@itemprop=\"postalCode\"]/text())').extract_first(),\n             \"ref\": ref,\n             \"website\": response.url,\n-            \"lat\": response.xpath(\n-                'normalize-space(//meta[@itemprop=\"latitude\"]/@content)'\n-            ).extract_first(),\n-            \"lon\": response.xpath(\n-                'normalize-space(//meta[@itemprop=\"longitude\"]/@content)'\n-            ).extract_first(),\n+            \"lat\": response.xpath('normalize-space(//meta[@itemprop=\"latitude\"]/@content)').extract_first(),\n+            \"lon\": response.xpath('normalize-space(//meta[@itemprop=\"longitude\"]/@content)').extract_first(),\n             \"name\": name,\n             \"opening_hours\": opening_hours,\n             \"extras\": {\"shop\": \"car_parts\"},\n", "issue": "Spider advanceautoparts is broken\nDuring the global build at 2021-05-21-20-28-08, spider **advanceautoparts** failed with **0 features** and **405 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-05-21-20-28-08/logs/advanceautoparts.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-21-20-28-08/output/advanceautoparts.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-21-20-28-08/output/advanceautoparts.geojson))\n", "before_files": [{"content": "import json\nimport re\n\nimport scrapy\n\nfrom locations.hours import OpeningHours\nfrom locations.items import GeojsonPointItem\n\n\nclass AdvanceautopartsSpider(scrapy.Spider):\n\n    name = \"advanceautoparts\"\n    item_attributes = {\"brand\": \"Advance Auto Parts\", \"brand_wikidata\": \"Q4686051\"}\n    allowed_domains = [\"stores.advanceautoparts.com\"]\n    start_urls = (\"https://stores.advanceautoparts.com/sitemap.xml\",)\n\n    def parse(self, response):\n        response.selector.remove_namespaces()\n        urls = response.xpath(\"//loc/text()\").getall()\n        storeRe = re.compile(r\"^https://stores.advanceautoparts.com/[^/]+/[^/]+/[^/]+$\")\n        for url in urls:\n            if storeRe.fullmatch(url):\n                yield scrapy.Request(url, callback=self.parse_store)\n\n    def parse_hours(self, store_hours):\n        opening_hours = OpeningHours()\n\n        for weekday in store_hours:\n            day = weekday.get(\"day\").title()\n            for interval in weekday.get(\"intervals\", []):\n                open_time = str(interval.get(\"start\"))\n                close_time = str(interval.get(\"end\"))\n                opening_hours.add_range(\n                    day=day[:2],\n                    open_time=open_time,\n                    close_time=close_time,\n                    time_format=\"%H%M\",\n                )\n\n        return opening_hours.as_opening_hours()\n\n    def parse_store(self, response):\n        name = response.xpath('//h1[@itemprop=\"name\"]/text()').extract_first()\n\n        js = json.loads(response.xpath('//script[@class=\"js-map-config\"]/text()').get())\n        ref = js[\"entities\"][0][\"profile\"][\"meta\"][\"id\"]\n\n        hours = response.xpath(\n            '//div[@class=\"c-hours-details-wrapper js-hours-table\"]/@data-days'\n        ).extract_first()\n        try:\n            opening_hours = self.parse_hours(json.loads(hours))\n        except ValueError:\n            opening_hours = None\n\n        properties = {\n            \"addr_full\": response.xpath(\n                'normalize-space(//meta[@itemprop=\"streetAddress\"]/@content)'\n            ).extract_first(),\n            \"phone\": response.xpath(\n                'normalize-space(//div[@itemprop=\"telephone\"]/text())'\n            ).extract_first(),\n            \"city\": response.xpath(\n                'normalize-space(//meta[@itemprop=\"addressLocality\"]/@content)'\n            ).extract_first(),\n            \"state\": response.xpath(\n                'normalize-space(//abbr[@itemprop=\"addressRegion\"]/text())'\n            ).extract_first(),\n            \"postcode\": response.xpath(\n                'normalize-space(//span[@itemprop=\"postalCode\"]/text())'\n            ).extract_first(),\n            \"ref\": ref,\n            \"website\": response.url,\n            \"lat\": response.xpath(\n                'normalize-space(//meta[@itemprop=\"latitude\"]/@content)'\n            ).extract_first(),\n            \"lon\": response.xpath(\n                'normalize-space(//meta[@itemprop=\"longitude\"]/@content)'\n            ).extract_first(),\n            \"name\": name,\n            \"opening_hours\": opening_hours,\n            \"extras\": {\"shop\": \"car_parts\"},\n        }\n        yield GeojsonPointItem(**properties)\n", "path": "locations/spiders/advanceautoparts.py"}], "after_files": [{"content": "import json\nimport re\n\nimport scrapy\n\nfrom locations.hours import OpeningHours\nfrom locations.items import GeojsonPointItem\n\n\nclass AdvanceautopartsSpider(scrapy.Spider):\n\n    name = \"advanceautoparts\"\n    item_attributes = {\"brand\": \"Advance Auto Parts\", \"brand_wikidata\": \"Q4686051\"}\n    allowed_domains = [\"stores.advanceautoparts.com\"]\n    start_urls = (\"https://stores.advanceautoparts.com/sitemap.xml\",)\n\n    def parse(self, response):\n        response.selector.remove_namespaces()\n        urls = response.xpath(\"//loc/text()\").getall()\n        storeRe = re.compile(r\"^https://stores.advanceautoparts.com/[^/]+/[^/]+/[^/]+$\")\n        for url in urls:\n            if storeRe.fullmatch(url):\n                yield scrapy.Request(url, callback=self.parse_store)\n\n    def parse_hours(self, store_hours):\n        opening_hours = OpeningHours()\n\n        for weekday in store_hours:\n            day = weekday.get(\"day\").title()\n            for interval in weekday.get(\"intervals\", []):\n                open_time = str(interval.get(\"start\"))\n                close_time = str(interval.get(\"end\"))\n                opening_hours.add_range(\n                    day=day[:2],\n                    open_time=open_time,\n                    close_time=close_time,\n                    time_format=\"%H%M\",\n                )\n\n        return opening_hours.as_opening_hours()\n\n    def parse_store(self, response):\n        name = response.xpath('//h1[@itemprop=\"name\"]/text()').extract_first()\n\n        js = json.loads(response.xpath('//script[@class=\"js-map-config\"]/text()').get())\n        ref = js[\"entities\"][0][\"profile\"][\"meta\"][\"id\"]\n\n        hours = response.xpath('//div[@class=\"c-hours-details-wrapper js-hours-table\"]/@data-days').extract_first()\n        try:\n            opening_hours = self.parse_hours(json.loads(hours))\n        except ValueError:\n            opening_hours = None\n\n        properties = {\n            \"addr_full\": response.xpath('normalize-space(//meta[@itemprop=\"streetAddress\"]/@content)').extract_first(),\n            \"phone\": response.xpath('normalize-space(//div[@itemprop=\"telephone\"]/text())').extract_first(),\n            \"city\": response.xpath('normalize-space(//meta[@itemprop=\"addressLocality\"]/@content)').extract_first(),\n            \"state\": response.xpath('normalize-space(//abbr[@itemprop=\"addressRegion\"]/text())').extract_first(),\n            \"postcode\": response.xpath('normalize-space(//span[@itemprop=\"postalCode\"]/text())').extract_first(),\n            \"ref\": ref,\n            \"website\": response.url,\n            \"lat\": response.xpath('normalize-space(//meta[@itemprop=\"latitude\"]/@content)').extract_first(),\n            \"lon\": response.xpath('normalize-space(//meta[@itemprop=\"longitude\"]/@content)').extract_first(),\n            \"name\": name,\n            \"opening_hours\": opening_hours,\n            \"extras\": {\"shop\": \"car_parts\"},\n        }\n        yield GeojsonPointItem(**properties)\n", "path": "locations/spiders/advanceautoparts.py"}]}