Repository: alltheplaces/alltheplaces

Issue:
Clothing Junction (ZA) (shop/clothes) (Metizsoft)
----
### Brand name

Clothing Junction

Clothing chain in South Africa

### Wikidata ID

Q116474981
https://www.wikidata.org/wiki/Q116474981
https://www.wikidata.org/wiki/Special:EntityData/Q116474981.json

### Store finder url(s)

Official Url(s): https://clothingjunction.co.za/
- [ ] I have run the below and if anything in generated, added it.
- [ ] I have manually checked for a storefinder
- [ ] This is not a manufacturer listing outlets operating under their own brands / this will not create duplicates
`pipenv run scrapy sf --brand-wikidata=Q116474981 https://clothingjunction.co.za/`
```
from locations.storefinders.metizsoft import MetizsoftSpider


class ClothingJunctionZASpider(MetizsoftSpider):
        name = "clothing_junction_za"
        item_attributes = {
                "brand_wikidata": "Q116474981",
                "brand": "Clothing Junction",
        }
        shopify_url = "clothing-junction-cj.myshopify.com"
```



Discussion:
Well, awks:
2024-02-26 11:18:06 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'atp/brand/Clothing Junction': 1,
 'atp/brand_wikidata/Q116474981': 1,
 'atp/category/shop/clothes': 1,
 'atp/field/country/from_spider_name': 1,
 'atp/field/email/missing': 1,
 'atp/field/image/missing': 1,
 'atp/field/opening_hours/missing': 1,
 'atp/field/operator/missing': 1,
 'atp/field/operator_wikidata/missing': 1,
 'atp/field/phone/missing': 1,
 'atp/field/twitter/missing': 1,
 'atp/field/website/missing': 1,
 'atp/nsi/perfect_match': 1,
 'downloader/request_bytes': 736,
 'downloader/request_count': 2,
 'downloader/request_method_count/GET': 1,
 'downloader/request_method_count/POST': 1,
 'downloader/response_bytes': 1304,
 'downloader/response_count': 2,
 'downloader/response_status_count/200': 1,
 'downloader/response_status_count/404': 1,
 'elapsed_time_seconds': 2.212632,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2024, 2, 26, 11, 18, 6, 419297, tzinfo=datetime.timezone.utc),
 'httpcompression/response_bytes': 703,
 'httpcompression/response_count': 1,
 'item_scraped_count': 1,
 'log_count/DEBUG': 14,
 'log_count/INFO': 9,
 'memusage/max': 150282240,
 'memusage/startup': 150282240,
 'response_received_count': 2,
 'robotstxt/request_count': 1,
 'robotstxt/response_count': 1,
 'robotstxt/response_status_count/404': 1,
 'scheduler/dequeued': 1,
 'scheduler/dequeued/memory': 1,
 'scheduler/enqueued': 1,
 'scheduler/enqueued/memory': 1,
 'start_time': datetime.datetime(2024, 2, 26, 11, 18, 4, 206665, tzinfo=datetime.timezone.utc)}
2024-02-26 11:18:06 [scrapy.core.engine] INFO: Spider closed (finished)

But https://clothingjunction.co.za/pages/store-locator 

Resolving patch:
diff --git a/locations/spiders/clothing_junction_za.py b/locations/spiders/clothing_junction_za.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/clothing_junction_za.py
@@ -0,0 +1,12 @@
+from locations.categories import Categories
+from locations.storefinders.storelocatorwidgets import StoreLocatorWidgetsSpider
+
+
+class ClothingJunctionZASpider(StoreLocatorWidgetsSpider):
+    name = "clothing_junction_za"
+    item_attributes = {
+        "brand": "Clothing Junction",
+        "brand_wikidata": "Q116474981",
+        "extras": Categories.SHOP_CLOTHES.value,
+    }
+    key = "N9yE0tiPbX9Z6diGz7MwPNqBWhMWA2uV"
diff --git a/locations/storefinders/storelocatorwidgets.py b/locations/storefinders/storelocatorwidgets.py
--- a/locations/storefinders/storelocatorwidgets.py
+++ b/locations/storefinders/storelocatorwidgets.py
@@ -72,8 +72,8 @@ def parse(self, response, **kwargs):
         for location in locations:
             item = DictParser.parse(location)
             item["ref"] = location["storeid"]
-            item["lat"] = location["data"]["map_lat"]
-            item["lon"] = location["data"]["map_lng"]
+            item["lat"] = location["data"].get("map_lat")
+            item["lon"] = location["data"].get("map_lng")
             item["addr_full"] = location["data"].get("address")
             if "phone" in location["data"]:
                 item["phone"] = location["data"]["phone"]


Test patch: