RaymondWeil - TheCodingMachine

advertisement
Web Parser – Raymond Weil
Parsing workflow
1) With the source code of the page http://www.raymond-weil.com/en/stores/search/map we
can get all the codes for the country having at least one store. These are in the tag <select
id="store_selector_country"><option
value="[COUNTRY_CODE]">[CONTRY_NAME]</option></select>.
2) Then we call the following URL for each country : http://www.raymondweil.com/tools/required/store_locator/store_list?locale=en_GB&countryCode=[COUNTRY_C
ODE]&stateNameSearch=&cityName=All
3) We get this (Switzerland here) :
address: "Transit aéroport de Genève"
address2: ""
address2_translated: ""
address_translated: "Transit aéroport de Genève"
aim: ""
city: "GENÈVE"
city_translated: "GENÈVE"
code_rwg: "600"
country: "CH"
countryName: "Switzerland"
dailymotion: ""
email: ""
email2: ""
error: ""
facebook: ""
fax: "022 798 23 08"
fax2: ""
fullAddress: "Transit aéroport de Genève<br>1215 Genève<br>Switzerland<br>Phone: 022 798
23 55<br>Fax: 022 798 23 08"
fullPath: "switzerland/geneve/air-watch-center/1241"
latitude: "46.232900"
linkedin: ""
locale: "en_GB"
longitude: "6.106800"
msn: ""
name: "Air Watch Center"
name_translated: "Air Watch Center"
opening_hours: ""
1
payment_options: "a:0:{}"
phone: "022 798 23 55"
phone2: ""
region: ""
region_translated: ""
sID: "1241"
saID: "1431"
skype: ""
twitter: ""
type: "1"
vimeo: ""
website: ""
website2: ""
youtube: ""
zip_code: "1215"
Attributes in blue need treatments.
Attributes in red will be stored in database for export.
Attribute state can be empty.
Treatments
One treatment is needed :

Getting the store_type : if the attribute type of JSON = 0 or 1 : « wholesaler »,
else if type = 3 : « boutique »
2
Data mapping
Export column
Origin
id
Database ID
brand_name
« Raymond Weil »
store_name
Attribute name_translated of the JSON object
store_address
Attribute address_translated of the JSON object
zip_code
Attribute zip_code of the JSON object
city
Attribute city_translated of the JSON object
state
-
country
Attribute country_name of the JSON object
continent
-
lat
Attribute latitude of the JSON object
long
Attribute longitude of the JSON object
store_type
Cf treatments
product_type
« Watches »
more_info
-
comment
-
3
Download