Jacob_Kold has asked for the wisdom of the Perl Monks concerning the following question:

Hi. Is there any way in which it is possible to web scrape the table in the following site which seems to be created from scalable vector graphics svg object. https://horsens.dk/Politik/PolitiskeUdvalg/42

Replies are listed 'Best First'.
Re: Scraping SVG. Scalable vector graphics
by Corion (Patriarch) on Jul 31, 2018 at 14:26 UTC

    SVG is "just" XML, so it should be possible to extract data from it.

    But, looking at the site you linked, I find no SVG on that site. There is an HTML table under the "Medlemmer" heading, but that is a plain HTML table.

    What problems did you encounter when trying to scrape that table?

    Update: As choroba notes, the HTML table is created through Javascript. This would mean you will need a Javascript-capable browser to render it, but it also opens up the nice avenue of reverse-engineering the way the data gets into the page. From a quick look at the page source code, you can look at this URL and use any of the JSON modules to get the data in a structured and machine-readable format:

    https://horsens.dk/-/api/MeetingApi/Meetings/%7B2696BF1A-2A62-4A62-AFF +5-020652874F14%7D

    That URL comes from the data-jsonurl attribute in this HTML:

    <div id="catalog-meetings" data-jsonurl="/-/api/MeetingApi/Meetings/{2 +696BF1A-2A62-4A62-AFF5-020652874F14}"></div>
Re: Scraping SVG. Scalable vector graphics
by choroba (Cardinal) on Jul 31, 2018 at 17:05 UTC