prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Spider xpo_logistics is broken
  During the global build at 2021-10-20-14-42-48, spider **xpo_logistics** failed with **0 features** and **1 errors**.
  
  Here's [the log](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/logs/xpo_logistics.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/xpo_logistics.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/xpo_logistics.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/xpo_logistics.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 import scrapy
  3 import re
  4 import ast
  5 from locations.items import GeojsonPointItem
  6 
  7 class XPOLogisticsSpider(scrapy.Spider):
  8     name = "xpo_logistics"
  9     item_attributes = { 'brand': "XPO Logistics" }
  10     allowed_domains = ["www.xpo.com"]
  11     start_urls = (
  12         'https://www.xpo.com/global-locations/',
  13     )
  14 
  15     def parse(self, response):
  16         script = response.xpath('//script[contains(.,"globalLocationsArray")]').extract_first()
  17         data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]
  18         data = ast.literal_eval(data)
  19 
  20         for store in data:
  21             yield GeojsonPointItem(
  22                 lat=float(store['latitude']),
  23                 lon=float(store['longitude'].replace(',','')),
  24                 phone=store['telephone'],
  25                 ref=store['office_name'],
  26                 addr_full=store['street'],
  27                 city=store['city'],
  28                 state=store['state'],
  29                 postcode=store['postal_code'],
  30                 country=store['country'],
  31                 name=store['office_name']
  32             )
  33 
  34 
  35
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/locations/spiders/xpo_logistics.py b/locations/spiders/xpo_logistics.py
  --- a/locations/spiders/xpo_logistics.py
  +++ b/locations/spiders/xpo_logistics.py
  @@ -1,28 +1,29 @@
   # -*- coding: utf-8 -*-
  -import scrapy
  -import re
   import ast
  +
  +import scrapy
  +
   from locations.items import GeojsonPointItem
   
  +
   class XPOLogisticsSpider(scrapy.Spider):
       name = "xpo_logistics"
  -    item_attributes = { 'brand': "XPO Logistics" }
  +    item_attributes = { 'brand': "XPO Logistics", 'brand_wikidata': 'Q8042415' }
       allowed_domains = ["www.xpo.com"]
       start_urls = (
           'https://www.xpo.com/global-locations/',
       )
   
       def parse(self, response):
  -        script = response.xpath('//script[contains(.,"globalLocationsArray")]').extract_first()
  -        data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]
  -        data = ast.literal_eval(data)
  +        script = response.xpath('//script[@id="globalLocations"]/text()').extract_first()
  +        data = ast.literal_eval(script)
   
           for store in data:
               yield GeojsonPointItem(
                   lat=float(store['latitude']),
                   lon=float(store['longitude'].replace(',','')),
                   phone=store['telephone'],
  -                ref=store['office_name'],
  +                ref=f"{store['office_name']}-{store['postal_code']}",
                   addr_full=store['street'],
                   city=store['city'],
                   state=store['state'],
  @@ -30,5 +31,3 @@
                   country=store['country'],
                   name=store['office_name']
               )
  -
  -
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/xpo_logistics.py b/locations/spiders/xpo_logistics.py\n--- a/locations/spiders/xpo_logistics.py\n+++ b/locations/spiders/xpo_logistics.py\n@@ -1,28 +1,29 @@\n # -*- coding: utf-8 -*-\n-import scrapy\n-import re\n import ast\n+\n+import scrapy\n+\n from locations.items import GeojsonPointItem\n \n+\n class XPOLogisticsSpider(scrapy.Spider):\n     name = \"xpo_logistics\"\n-    item_attributes = { 'brand': \"XPO Logistics\" }\n+    item_attributes = { 'brand': \"XPO Logistics\", 'brand_wikidata': 'Q8042415' }\n     allowed_domains = [\"www.xpo.com\"]\n     start_urls = (\n         'https://www.xpo.com/global-locations/',\n     )\n \n     def parse(self, response):\n-        script = response.xpath('//script[contains(.,\"globalLocationsArray\")]').extract_first()\n-        data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]\n-        data = ast.literal_eval(data)\n+        script = response.xpath('//script[@id=\"globalLocations\"]/text()').extract_first()\n+        data = ast.literal_eval(script)\n \n         for store in data:\n             yield GeojsonPointItem(\n                 lat=float(store['latitude']),\n                 lon=float(store['longitude'].replace(',','')),\n                 phone=store['telephone'],\n-                ref=store['office_name'],\n+                ref=f\"{store['office_name']}-{store['postal_code']}\",\n                 addr_full=store['street'],\n                 city=store['city'],\n                 state=store['state'],\n@@ -30,5 +31,3 @@\n                 country=store['country'],\n                 name=store['office_name']\n             )\n-\n-\n", "issue": "Spider xpo_logistics is broken\nDuring the global build at 2021-10-20-14-42-48, spider **xpo_logistics** failed with **0 features** and **1 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/logs/xpo_logistics.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/xpo_logistics.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/xpo_logistics.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport scrapy\nimport re\nimport ast\nfrom locations.items import GeojsonPointItem\n\nclass XPOLogisticsSpider(scrapy.Spider):\n    name = \"xpo_logistics\"\n    item_attributes = { 'brand': \"XPO Logistics\" }\n    allowed_domains = [\"www.xpo.com\"]\n    start_urls = (\n        'https://www.xpo.com/global-locations/',\n    )\n\n    def parse(self, response):\n        script = response.xpath('//script[contains(.,\"globalLocationsArray\")]').extract_first()\n        data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]\n        data = ast.literal_eval(data)\n\n        for store in data:\n            yield GeojsonPointItem(\n                lat=float(store['latitude']),\n                lon=float(store['longitude'].replace(',','')),\n                phone=store['telephone'],\n                ref=store['office_name'],\n                addr_full=store['street'],\n                city=store['city'],\n                state=store['state'],\n                postcode=store['postal_code'],\n                country=store['country'],\n                name=store['office_name']\n            )\n\n\n", "path": "locations/spiders/xpo_logistics.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nimport ast\n\nimport scrapy\n\nfrom locations.items import GeojsonPointItem\n\n\nclass XPOLogisticsSpider(scrapy.Spider):\n    name = \"xpo_logistics\"\n    item_attributes = { 'brand': \"XPO Logistics\", 'brand_wikidata': 'Q8042415' }\n    allowed_domains = [\"www.xpo.com\"]\n    start_urls = (\n        'https://www.xpo.com/global-locations/',\n    )\n\n    def parse(self, response):\n        script = response.xpath('//script[@id=\"globalLocations\"]/text()').extract_first()\n        data = ast.literal_eval(script)\n\n        for store in data:\n            yield GeojsonPointItem(\n                lat=float(store['latitude']),\n                lon=float(store['longitude'].replace(',','')),\n                phone=store['telephone'],\n                ref=f\"{store['office_name']}-{store['postal_code']}\",\n                addr_full=store['street'],\n                city=store['city'],\n                state=store['state'],\n                postcode=store['postal_code'],\n                country=store['country'],\n                name=store['office_name']\n            )\n", "path": "locations/spiders/xpo_logistics.py"}]}