Notifications
Clear all
Power Query
2
Posts
2
Users
0
Reactions
103
Views
Topic starter
Hi all !
So, I have to make a list of the mayors in Calvados, Normandy (528 of them..).
So there’s this website called AMF ( https://www.amf.asso.fr/annuaire-communes-intercommunalites?refer=departement&dep_n_id=14 ) which gives me the list of all the cities in Calvados. However in order to have the name of the mayor you’d have to click individually on the name of the city + there’s one page per letter in the alphabet.
Ideally I’d want the name of the city, the « Insee code », the name of the mayor, and for it to update of the website updates changes.
I have reached out to Mynda who sent me the link to her web scraping video but I can’t seem to understand the « formula » part. I get that the URL is predictable, but I can’t get it to work + when I do a web query I don’t have the option of creating a table based on an example.
It’s a lot to ask but I don’t really care for a file to be sent to me without any explanation, I’d love a detailed answer, as I’d like to be able to do it again in the future by myself.
by the way, intermediate user here, but eager to learn !
by the way, intermediate user here, but eager to learn !
Thank you in advance !
Alex
Posted : 10/12/2020 4:29 am
Hi Alex,
Since the page doesn't have any tables, you need to drill down on the Document tables until you find the information you want. In the attached file I've created an example using 3 Insee values. You'll notice insee 14003 must have a different page structure because the mayor is in the city column. Not much you can do about this if the source data isn't consistent and you don't want to use Power BI to get the data using 'from examples'.
I hope that points you in the right direction. You will need to create your own list of Insee values for use in the query.
Mynda
Posted : 10/12/2020 8:20 am