prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  nationwide_gb spider returning closed branches
  The nationwide_gb spide is currently returning a number of branches that are described as "Permanently Closed" on their web pages. For example:
  
  * https://www.nationwide.co.uk/branches/glasgow/1635-great-western-road
  * https://www.nationwide.co.uk/branches/bournemouth/10-southbourne-grove
  * https://www.nationwide.co.uk/branches/london/129-balham-high-road
  
  They all have "- permanently closed" appended to their names, which might be robust enough to use to detect them. If not, they have their opening times for each day set to "closed".
  nationwide_gb spider missing branches (regex not general enough)
  According to e.g. https://www.altfi.com/article/9347_nationwide-pledges-to-keep-its-625-branches-open-until-2024 Nationwide should have 625 UK branches. The current nationwide_gb spider is only returning 549.
  
  One issue that is probably behind most (if not all) of the missing branches is that the regex `r"https:\/\/www\.nationwide\.co\.uk\/branches\/[-()\w]+\/[-\w]+$"` used to detect branch page URLs is not sufficiently general. In addition to word characters and hypens the final (branch) part of the URL can also contain a forward slash (used to denote house-number ranges).
  
  For example: https://www.nationwide.co.uk/branches/northampton/18/19-weston-favell-centre
  
  --- 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/nationwide_gb.py`
  Content:
  ```
  1 from scrapy.linkextractors import LinkExtractor
  2 from scrapy.spiders import CrawlSpider, Rule
  3 
  4 from locations.structured_data_spider import StructuredDataSpider
  5 
  6 
  7 class NationwideGB(CrawlSpider, StructuredDataSpider):
  8     name = "nationwide_gb"
  9     item_attributes = {"brand": "Nationwide", "brand_wikidata": "Q846735"}
  10     start_urls = ["https://www.nationwide.co.uk/branches/index.html"]
  11     rules = [
  12         Rule(
  13             LinkExtractor(
  14                 allow=r"https:\/\/www\.nationwide\.co\.uk\/branches\/[-()\w]+\/[-\w]+$"
  15             ),
  16             callback="parse_sd",
  17         ),
  18         Rule(
  19             LinkExtractor(
  20                 allow=r"https:\/\/www\.nationwide\.co\.uk\/branches\/[-()\w]+$"
  21             )
  22         ),
  23     ]
  24     wanted_types = ["BankOrCreditUnion"]
  25
  ```
  --- 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/nationwide_gb.py b/locations/spiders/nationwide_gb.py
  --- a/locations/spiders/nationwide_gb.py
  +++ b/locations/spiders/nationwide_gb.py
  @@ -1,24 +1,20 @@
   from scrapy.linkextractors import LinkExtractor
   from scrapy.spiders import CrawlSpider, Rule
   
  +from locations.categories import Categories
   from locations.structured_data_spider import StructuredDataSpider
   
   
   class NationwideGB(CrawlSpider, StructuredDataSpider):
       name = "nationwide_gb"
  -    item_attributes = {"brand": "Nationwide", "brand_wikidata": "Q846735"}
  +    item_attributes = {
  +        "brand": "Nationwide",
  +        "brand_wikidata": "Q846735",
  +        "extras": Categories.BANK.value,
  +    }
       start_urls = ["https://www.nationwide.co.uk/branches/index.html"]
  -    rules = [
  -        Rule(
  -            LinkExtractor(
  -                allow=r"https:\/\/www\.nationwide\.co\.uk\/branches\/[-()\w]+\/[-\w]+$"
  -            ),
  -            callback="parse_sd",
  -        ),
  -        Rule(
  -            LinkExtractor(
  -                allow=r"https:\/\/www\.nationwide\.co\.uk\/branches\/[-()\w]+$"
  -            )
  -        ),
  -    ]
  -    wanted_types = ["BankOrCreditUnion"]
  +    rules = [Rule(LinkExtractor(allow=r"/branches/"), callback="parse_sd", follow=True)]
  +
  +    def post_process_item(self, item, response, ld_data, **kwargs):
  +        if "permanently closed" not in item["name"].lower():
  +            yield item
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/nationwide_gb.py b/locations/spiders/nationwide_gb.py\n--- a/locations/spiders/nationwide_gb.py\n+++ b/locations/spiders/nationwide_gb.py\n@@ -1,24 +1,20 @@\n from scrapy.linkextractors import LinkExtractor\n from scrapy.spiders import CrawlSpider, Rule\n \n+from locations.categories import Categories\n from locations.structured_data_spider import StructuredDataSpider\n \n \n class NationwideGB(CrawlSpider, StructuredDataSpider):\n     name = \"nationwide_gb\"\n-    item_attributes = {\"brand\": \"Nationwide\", \"brand_wikidata\": \"Q846735\"}\n+    item_attributes = {\n+        \"brand\": \"Nationwide\",\n+        \"brand_wikidata\": \"Q846735\",\n+        \"extras\": Categories.BANK.value,\n+    }\n     start_urls = [\"https://www.nationwide.co.uk/branches/index.html\"]\n-    rules = [\n-        Rule(\n-            LinkExtractor(\n-                allow=r\"https:\\/\\/www\\.nationwide\\.co\\.uk\\/branches\\/[-()\\w]+\\/[-\\w]+$\"\n-            ),\n-            callback=\"parse_sd\",\n-        ),\n-        Rule(\n-            LinkExtractor(\n-                allow=r\"https:\\/\\/www\\.nationwide\\.co\\.uk\\/branches\\/[-()\\w]+$\"\n-            )\n-        ),\n-    ]\n-    wanted_types = [\"BankOrCreditUnion\"]\n+    rules = [Rule(LinkExtractor(allow=r\"/branches/\"), callback=\"parse_sd\", follow=True)]\n+\n+    def post_process_item(self, item, response, ld_data, **kwargs):\n+        if \"permanently closed\" not in item[\"name\"].lower():\n+            yield item\n", "issue": "nationwide_gb spider returning closed branches\nThe nationwide_gb spide is currently returning a number of branches that are described as \"Permanently Closed\" on their web pages. For example:\r\n\r\n* https://www.nationwide.co.uk/branches/glasgow/1635-great-western-road\r\n* https://www.nationwide.co.uk/branches/bournemouth/10-southbourne-grove\r\n* https://www.nationwide.co.uk/branches/london/129-balham-high-road\r\n\r\nThey all have \"- permanently closed\" appended to their names, which might be robust enough to use to detect them. If not, they have their opening times for each day set to \"closed\".\nnationwide_gb spider missing branches (regex not general enough)\nAccording to e.g. https://www.altfi.com/article/9347_nationwide-pledges-to-keep-its-625-branches-open-until-2024 Nationwide should have 625 UK branches. The current nationwide_gb spider is only returning 549.\r\n\r\nOne issue that is probably behind most (if not all) of the missing branches is that the regex `r\"https:\\/\\/www\\.nationwide\\.co\\.uk\\/branches\\/[-()\\w]+\\/[-\\w]+$\"` used to detect branch page URLs is not sufficiently general. In addition to word characters and hypens the final (branch) part of the URL can also contain a forward slash (used to denote house-number ranges).\r\n\r\nFor example: https://www.nationwide.co.uk/branches/northampton/18/19-weston-favell-centre\n", "before_files": [{"content": "from scrapy.linkextractors import LinkExtractor\nfrom scrapy.spiders import CrawlSpider, Rule\n\nfrom locations.structured_data_spider import StructuredDataSpider\n\n\nclass NationwideGB(CrawlSpider, StructuredDataSpider):\n    name = \"nationwide_gb\"\n    item_attributes = {\"brand\": \"Nationwide\", \"brand_wikidata\": \"Q846735\"}\n    start_urls = [\"https://www.nationwide.co.uk/branches/index.html\"]\n    rules = [\n        Rule(\n            LinkExtractor(\n                allow=r\"https:\\/\\/www\\.nationwide\\.co\\.uk\\/branches\\/[-()\\w]+\\/[-\\w]+$\"\n            ),\n            callback=\"parse_sd\",\n        ),\n        Rule(\n            LinkExtractor(\n                allow=r\"https:\\/\\/www\\.nationwide\\.co\\.uk\\/branches\\/[-()\\w]+$\"\n            )\n        ),\n    ]\n    wanted_types = [\"BankOrCreditUnion\"]\n", "path": "locations/spiders/nationwide_gb.py"}], "after_files": [{"content": "from scrapy.linkextractors import LinkExtractor\nfrom scrapy.spiders import CrawlSpider, Rule\n\nfrom locations.categories import Categories\nfrom locations.structured_data_spider import StructuredDataSpider\n\n\nclass NationwideGB(CrawlSpider, StructuredDataSpider):\n    name = \"nationwide_gb\"\n    item_attributes = {\n        \"brand\": \"Nationwide\",\n        \"brand_wikidata\": \"Q846735\",\n        \"extras\": Categories.BANK.value,\n    }\n    start_urls = [\"https://www.nationwide.co.uk/branches/index.html\"]\n    rules = [Rule(LinkExtractor(allow=r\"/branches/\"), callback=\"parse_sd\", follow=True)]\n\n    def post_process_item(self, item, response, ld_data, **kwargs):\n        if \"permanently closed\" not in item[\"name\"].lower():\n            yield item\n", "path": "locations/spiders/nationwide_gb.py"}]}