Parsing Statistics Canada HTML page

I read your post in community about parsing the HTML table in EasyMorph. I downloaded the sample in the post, and change the URL parameter to Economic Data in Wikipedia, it works!

However, it doesn’t work for the following page:

Gross domestic product (GDP) at basic prices, by industry, monthly, growth rates

I tried a few things: e.g instead of getting the TagName, I tried getting by ClassName and ID. Unfortunately none of them works.

I’m wondering if you can help look into it?

You may not need to parse the HTML page at all. The website already provides hyperlinks to download CSV files with the data displayed:

Hi thanks for looking into this. We want to schedule the job in EasyMorph to go multiple stats website download the data instead of manually downloading tables from there. Is it still doable using the PowerShell?

Hi Christina and welcome to the Community!

The download buttons on the website are actually hyperlinks. You can use them to download CSV files with page data automatically. Would that work for you?

Also Statistics Canada makes its data available via APIs to eliminate the need to parse HTMLs. Check out this page: Developers

Hi, the download options with link address still requires the manual process to download the files individually.

I checked the developers session – web data service – getFullTableDownloadSDMX
https://www.statcan.gc.ca/eng/developers?HPA=1

Would it fit for Web Request? below is my screenshot:
image

If you’re working with the API, the “Web request” action is the most convenient way of doing it. The action is very flexible and has many options. I would suggest checking out the web-help article on the action, it’s pretty comprehensive: transformations:webrequest [EasyMorph Help]

Below is a sample project that downloads a file using the getFullTableDownloadSDMX endpoint.

statcan.morph (3.9 KB)

Thank you very much! that’s really helpful, I’ll try that on my end