
New Member

September 2, 2022

Hi,
Here is the scenario in which I got stuck and seeking your valuable advice for the same.
Here is the GitHub link containing category wise public API links:
https://github.com/public-apis.....#test-data
It contains around 51 different categories listed as index at the beginning. As you scroll down the page you would find that each of the categories are presented in the HTML table format.
My objective is to fetch each of the API (URL) under each of the topics along with the other table information and collated in the one single table.
To accomplish the task I have chosen Power Query utility and tried in Office365(Excel) and Power BI Desktop.
The challenge I had faced while executing the task:
Step1: Using the above GitHub link I had reached until this:
[Image Can Not Be Found]
Chris Webb's Blog link: Chris Webb's BI Blog: Using Html.Table() To Extract URLs From A Web Page In Power BI/Power Query M C...
And the portion of the code after making relevant modification is:
"Added Custom" = Table.AddColumn(Html.Table(Source, {{"Links", "a[href^=""http""]", each [Attributes][href]}}))
and later on this by following this blog:
Power Query – how to simply get hyperlinks from webpages – Trainings, consultancy, tutorials
#"Added Custom" = Table.AddColumn(Source, {{"API_URL", ":nth-last-child(155) > TBODY > TR > :nth-child(1) > A[rel=""nofollow""]:nth-child(1):nth-last-child(1)", each [Attributes][href]?}}, [RowSelector="TABLE:nth-child(20) > TBODY > TR"])
In either of the cases I could not be able to achieve the desired goal.
In this case I was not able to add the URL column with the rest of the datasets to accomplish the task.
Please let me know if any other information you could need to recreate the steps.


October 5, 2010

Hi Ritabrata,
Html.Table only works in PBI and it requires a CSS selector to get the data from the web page. The tables on that GitHub page have no CSS classes to identify them so Html.Table can't be used.
The code in the file below grabs the entire page and then using things like Text.BetweenDelimiters, extracts the following data:
Regards
Phil
1 Guest(s)
