#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Posts
    25
    Rep Power
    0

    workin with PYthon & JSON


    i am currently diving into python with some practical works.

    Fetching JSON data and parsing - and subseqeuentliy - storing it into db.


    When I visited the list a demo-site - see here a page with establishments in hospital - see the web page,

    I saw that the site uses its very own private API to get the list of establishments in the first place.

    We can check out: https://ws.scopesante.fr/v4/carte-etablissements

    The private API returns the full list of establishments along with their "id" numbers in
    JSON format. So, there we go. This is the full list tthat is currently in JSON - formate.
    We can use the "id" number of each organization to look up the "details" page for each
    organization. So, if we re using the route to the "details" page:

    https://www.scopesante.fr#/etablisse...che-detaillee/

    We surely can just grab all the " numbers, put them in a Python list, and afterwards - then
    iterate over that list (as oppose to trying to count up as we like it).

    There are about 4400 establishments; specifically, I am seeing 386 establishments. But,
    we have access to see the "id" number for each organization. So, it is more efficient to use these "id" numbers when we scrape the website.


    I have found morue aout the API even more and found that we can get the details for
    a specific establishment directly by calling the API. See:

    https://ws.scopesante.fr/v4/fiche-identite/010000024

    This returns the details on the specific establishment.
    We just have to replace the number on the end of the URL with
    the "id" number of the establishment we are looking up.
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,972
    Rep Power
    510
    Good work!
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Posts
    25
    Rep Power
    0
    hello dear b49

    sure thing - but i am musing about an approach to dive into json to csv export

IMN logo majestic logo threadwatch logo seochat tools logo