Closed Dimitar5555 closed 2 months ago
Javascript drama
from scrapy import Spider
from locations.categories import Categories, Extras, apply_category, apply_yes_no
from locations.dict_parser import DictParser
class UbbBGSpider(Spider):
name = "ubb_bg"
item_attributes = {"brand_wikidata": "Q7887555"}
start_urls = ["https://www.ubb.bg/offices/pins"]
def parse(self, response, **kwargs):
print(response.text)
for location in response.json()["markers"]["offices"]:
item = DictParser.parse(location["data"])
apply_yes_no(Extras.WHEELCHAIR, item, location["data"]["has_accessibility"])
if location["data"]["pin_type"] == "offices":
apply_category(Categories.BANK, item)
else:
apply_category(Categories.ATM, item)
yield item
The ATMs are located in ["markers"]["atms"]
.
I've just noticed that they also list their child's bank offices and ATMs. When pin_type
is kbc_office
or kbc_atms
, it should get brand=UBB* + brand:wikidata=Q7283808
. That brand is not added to NSI because of https://github.com/osmlab/name-suggestion-index/issues/8626.
Brand name
UBB / ОББ
Wikidata ID
Q7887555
Store finder url(s)
https://www.ubb.bg/offices/pins?city_id=&srch_offices=&_=1694684624025
pin_type
is used to diffrentiate betweenoffices
andatms
.