prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Spider valero is broken
  During the global build at 2021-07-14-14-42-22, spider **valero** failed with **0 features** and **1 errors**.
  
  Here's [the log](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/logs/valero.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/valero.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/valero.geojson))
  
  </issue>
  <code>
  [start of locations/spiders/valero.py]
  1 # -*- coding: utf-8 -*-
  2 import scrapy
  3 import json
  4 from locations.items import GeojsonPointItem
  5 
  6 
  7 class ValeroSpider(scrapy.Spider):
  8     name = "valero"
  9     item_attributes = {'brand': "Valero", 'brand_wikidata': 'Q1283291'}
  10     allowed_domains = ["valeromaps.valero.com"]
  11 
  12     def start_requests(self):
  13         yield scrapy.FormRequest(
  14             'https://valeromaps.valero.com/Home/Search?SPHostUrl=https:%2F%2Fwww.valero.com%2Fen-us',
  15             method='POST',
  16             headers={
  17                 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
  18             },
  19             formdata={
  20                 'NEBound_Lat': '90',
  21                 'NEBound_Long': '180',
  22                 'SWBound_Lat': '-90',
  23                 'SWBound_Long': '-180',
  24                 'center_Lat': '0',
  25                 'center_Long': '0'
  26             }
  27         )
  28 
  29     def parse(self, response):
  30         result = json.loads(response.body_as_unicode())
  31         for store in result['StoreList']:
  32             details = ', '.join([d['DetailName'] for d in store['Details']])
  33             yield GeojsonPointItem(
  34                 lon=store['Longitude'],
  35                 lat=store['Latitude'],
  36                 ref=store['UniqueID'],
  37                 name=store['StationName'],
  38                 addr_full=store['Address'],
  39                 phone=store['Phone'],
  40                 opening_hours='24/7' if '24 Hours' in details else None,
  41                 extras={
  42                     'amenity:fuel': True,
  43                     'amenity:toilets': 'Restroom' in details or None,
  44                     'atm': 'ATM' in details,
  45                     'car_wash': 'Car Wash' in details,
  46                     'fuel:diesel': 'Diesel' in details or None,
  47                     'fuel:e85': 'E-85' in details or None,
  48                 }
  49             )
  50
  [end of locations/spiders/valero.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/locations/spiders/valero.py b/locations/spiders/valero.py
  --- a/locations/spiders/valero.py
  +++ b/locations/spiders/valero.py
  @@ -1,49 +1,39 @@
   # -*- coding: utf-8 -*-
   import scrapy
   import json
  +
   from locations.items import GeojsonPointItem
   
   
   class ValeroSpider(scrapy.Spider):
       name = "valero"
  -    item_attributes = {'brand': "Valero", 'brand_wikidata': 'Q1283291'}
  -    allowed_domains = ["valeromaps.valero.com"]
  -
  -    def start_requests(self):
  -        yield scrapy.FormRequest(
  -            'https://valeromaps.valero.com/Home/Search?SPHostUrl=https:%2F%2Fwww.valero.com%2Fen-us',
  -            method='POST',
  -            headers={
  -                'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
  -            },
  -            formdata={
  -                'NEBound_Lat': '90',
  -                'NEBound_Long': '180',
  -                'SWBound_Lat': '-90',
  -                'SWBound_Long': '-180',
  -                'center_Lat': '0',
  -                'center_Long': '0'
  -            }
  -        )
  +    item_attributes = {"brand": "Valero", "brand_wikidata": "Q1283291"}
  +    allowed_domains = ["valero.com"]
  +    start_urls = ["https://locations.valero.com/sitemap.xml"]
   
       def parse(self, response):
  -        result = json.loads(response.body_as_unicode())
  -        for store in result['StoreList']:
  -            details = ', '.join([d['DetailName'] for d in store['Details']])
  -            yield GeojsonPointItem(
  -                lon=store['Longitude'],
  -                lat=store['Latitude'],
  -                ref=store['UniqueID'],
  -                name=store['StationName'],
  -                addr_full=store['Address'],
  -                phone=store['Phone'],
  -                opening_hours='24/7' if '24 Hours' in details else None,
  -                extras={
  -                    'amenity:fuel': True,
  -                    'amenity:toilets': 'Restroom' in details or None,
  -                    'atm': 'ATM' in details,
  -                    'car_wash': 'Car Wash' in details,
  -                    'fuel:diesel': 'Diesel' in details or None,
  -                    'fuel:e85': 'E-85' in details or None,
  -                }
  -            )
  +        response.selector.remove_namespaces()
  +        for url in response.xpath("//loc/text()").extract():
  +            yield scrapy.Request(url, callback=self.parse_store)
  +
  +    def parse_store(self, response):
  +        amenities = [s.strip() for s in response.xpath('//div[@class="amenityIconLabel"]/text()').extract()]
  +        properties = {
  +            "lat": response.xpath('//meta[@property="place:location:latitude"]/@content').get(),
  +            "lon": response.xpath('//meta[@property="place:location:longitude"]/@content').get(),
  +            "ref": response.url.rsplit("/", 1)[-1],
  +            "website": response.url,
  +            "name": response.xpath('normalize-space(//*[@id="pageTitleStoreName"])').get(),
  +            "addr_full": response.xpath('normalize-space(//div[@class="locationDetailsContactRow"][1]//br/..)').get(),
  +            "phone": response.xpath('//a[contains(@href,"tel:")]/text()').get(),
  +            "opening_hours": "24/7" if "24 Hour" in amenities else None,
  +            "extras": {
  +                "atm": "ATM" in amenities,
  +                "amenity:fuel": True,
  +                "amenity:toilets": "Public Restroom" in amenities or None,
  +                "car_wash": "Car Wash" in amenities,
  +                "fuel:diesel": "Diesel" in amenities or None,
  +                "fuel:e85": "E-85" in amenities or None,
  +            },
  +        }
  +        yield GeojsonPointItem(**properties)
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/valero.py b/locations/spiders/valero.py\n--- a/locations/spiders/valero.py\n+++ b/locations/spiders/valero.py\n@@ -1,49 +1,39 @@\n # -*- coding: utf-8 -*-\n import scrapy\n import json\n+\n from locations.items import GeojsonPointItem\n \n \n class ValeroSpider(scrapy.Spider):\n     name = \"valero\"\n-    item_attributes = {'brand': \"Valero\", 'brand_wikidata': 'Q1283291'}\n-    allowed_domains = [\"valeromaps.valero.com\"]\n-\n-    def start_requests(self):\n-        yield scrapy.FormRequest(\n-            'https://valeromaps.valero.com/Home/Search?SPHostUrl=https:%2F%2Fwww.valero.com%2Fen-us',\n-            method='POST',\n-            headers={\n-                'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'\n-            },\n-            formdata={\n-                'NEBound_Lat': '90',\n-                'NEBound_Long': '180',\n-                'SWBound_Lat': '-90',\n-                'SWBound_Long': '-180',\n-                'center_Lat': '0',\n-                'center_Long': '0'\n-            }\n-        )\n+    item_attributes = {\"brand\": \"Valero\", \"brand_wikidata\": \"Q1283291\"}\n+    allowed_domains = [\"valero.com\"]\n+    start_urls = [\"https://locations.valero.com/sitemap.xml\"]\n \n     def parse(self, response):\n-        result = json.loads(response.body_as_unicode())\n-        for store in result['StoreList']:\n-            details = ', '.join([d['DetailName'] for d in store['Details']])\n-            yield GeojsonPointItem(\n-                lon=store['Longitude'],\n-                lat=store['Latitude'],\n-                ref=store['UniqueID'],\n-                name=store['StationName'],\n-                addr_full=store['Address'],\n-                phone=store['Phone'],\n-                opening_hours='24/7' if '24 Hours' in details else None,\n-                extras={\n-                    'amenity:fuel': True,\n-                    'amenity:toilets': 'Restroom' in details or None,\n-                    'atm': 'ATM' in details,\n-                    'car_wash': 'Car Wash' in details,\n-                    'fuel:diesel': 'Diesel' in details or None,\n-                    'fuel:e85': 'E-85' in details or None,\n-                }\n-            )\n+        response.selector.remove_namespaces()\n+        for url in response.xpath(\"//loc/text()\").extract():\n+            yield scrapy.Request(url, callback=self.parse_store)\n+\n+    def parse_store(self, response):\n+        amenities = [s.strip() for s in response.xpath('//div[@class=\"amenityIconLabel\"]/text()').extract()]\n+        properties = {\n+            \"lat\": response.xpath('//meta[@property=\"place:location:latitude\"]/@content').get(),\n+            \"lon\": response.xpath('//meta[@property=\"place:location:longitude\"]/@content').get(),\n+            \"ref\": response.url.rsplit(\"/\", 1)[-1],\n+            \"website\": response.url,\n+            \"name\": response.xpath('normalize-space(//*[@id=\"pageTitleStoreName\"])').get(),\n+            \"addr_full\": response.xpath('normalize-space(//div[@class=\"locationDetailsContactRow\"][1]//br/..)').get(),\n+            \"phone\": response.xpath('//a[contains(@href,\"tel:\")]/text()').get(),\n+            \"opening_hours\": \"24/7\" if \"24 Hour\" in amenities else None,\n+            \"extras\": {\n+                \"atm\": \"ATM\" in amenities,\n+                \"amenity:fuel\": True,\n+                \"amenity:toilets\": \"Public Restroom\" in amenities or None,\n+                \"car_wash\": \"Car Wash\" in amenities,\n+                \"fuel:diesel\": \"Diesel\" in amenities or None,\n+                \"fuel:e85\": \"E-85\" in amenities or None,\n+            },\n+        }\n+        yield GeojsonPointItem(**properties)\n", "issue": "Spider valero is broken\nDuring the global build at 2021-07-14-14-42-22, spider **valero** failed with **0 features** and **1 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/logs/valero.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/valero.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/valero.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport scrapy\nimport json\nfrom locations.items import GeojsonPointItem\n\n\nclass ValeroSpider(scrapy.Spider):\n    name = \"valero\"\n    item_attributes = {'brand': \"Valero\", 'brand_wikidata': 'Q1283291'}\n    allowed_domains = [\"valeromaps.valero.com\"]\n\n    def start_requests(self):\n        yield scrapy.FormRequest(\n            'https://valeromaps.valero.com/Home/Search?SPHostUrl=https:%2F%2Fwww.valero.com%2Fen-us',\n            method='POST',\n            headers={\n                'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'\n            },\n            formdata={\n                'NEBound_Lat': '90',\n                'NEBound_Long': '180',\n                'SWBound_Lat': '-90',\n                'SWBound_Long': '-180',\n                'center_Lat': '0',\n                'center_Long': '0'\n            }\n        )\n\n    def parse(self, response):\n        result = json.loads(response.body_as_unicode())\n        for store in result['StoreList']:\n            details = ', '.join([d['DetailName'] for d in store['Details']])\n            yield GeojsonPointItem(\n                lon=store['Longitude'],\n                lat=store['Latitude'],\n                ref=store['UniqueID'],\n                name=store['StationName'],\n                addr_full=store['Address'],\n                phone=store['Phone'],\n                opening_hours='24/7' if '24 Hours' in details else None,\n                extras={\n                    'amenity:fuel': True,\n                    'amenity:toilets': 'Restroom' in details or None,\n                    'atm': 'ATM' in details,\n                    'car_wash': 'Car Wash' in details,\n                    'fuel:diesel': 'Diesel' in details or None,\n                    'fuel:e85': 'E-85' in details or None,\n                }\n            )\n", "path": "locations/spiders/valero.py"}]}