Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pedro_Lourenco
Frequent Visitor

Web scraping with search tool

Hi,

 

I'm trying to get some data automatically from a website with the Power BI. Unfortunately, I'm not very familiar with this mechanic so if possible explain to me how to do it I will be very grateful.

 

I have a list with some codes that are the National Register of Legal Entities (as a sample the Table below) 

 

National Register Legal Entities
3883571000100
33913620000170
31964019000181
30509213000104
34172417000153
29298535000172
17329708000193
4299584000107
831328000150
4323964000121

 

First problem is that some of these entries need to insert a zero in front of the code in order to work in the website search tool and others will still not be localized by the website.

 

So, going to the mechanic... the website that I want to scrap the data is this one: https://magnetis.com.br/fundos-de-investimento/

 

site magnetic entrada.PNG

Inside the field highlighted I insert the code from the list, then it returns me an option.

 

site magnetic search.PNG

 

When I click in that box I'm redirected to the page with the information that I want.

*Notice that the URL changed.

site magnetic inter.png

 

There are basically four pieces of information that I want to scrap, three of them can be found in the blue box at the beginning of the page. Following our example:

 

Name: 051 Brucutu Fundo de Investimento Multimercado Crédito Privado

Gestora: Zero Cinco Um C API Tal Gestao de Recursos

Categoria: Multimercado

 

The last is found in a chart below the page and it is the TOTAL appointed in the far right dot of the chart.

site magnetic PL.png

 

In the example, the latest data is from January 9th, so it`s that one that I want it

 

 

Total PL: R$10,507,667.87

 

with these four information, I want to build a table like the one below with a National Register in every row. If the site don't find return the fields blank()

 

National Register Legal EntitiesNameGestoraCategoriaTotal PL
33913620000170

051 Brucutu Fundo de Investimento Multimercado Crédito Privado

Zero Cinco Um C API Tal Gestao de Recursos

MultimercadoR$10,507,667.87

 

 

Few... that was a lot haha

Can anyone help me?

 

Thanks

 

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Pedro_Lourenco,

Unfortunate, you can't directly get data from web site(power query not able to invoke script and request redirect on web page, it can only get the HTML elements).
You need to find out the source API that web site invoked, then use power query web connector to get data from that API.

Regards,

Xioaxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors