Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have tried a few different things and cannot seem to get it to work . I want to pulll 10-20 pages of data from a FINVIZ Screener and I can only get the first page to pull .
I am using a blank query or trying to pull from the web as a data source. I am guessing I need a function but cannot seem to get it to work. Web link is below
Thanks
Solved! Go to Solution.
All you need is to add r=start_row to your query. Here is a query with Offset and NumberOfPages parameters. I also incorporated parsing of the table - obviously this part can break easily if the underlying html gets changed in an update.
let
// screener data parameters
Param_View = "151",
Param_Filter = "ta_rsi_os40",
Param_Order = "ticker",
// screener paging parameters
Param_Offset = 2,
Param_NumberOfPages = 4,
// screener constants - do not change
Constant_PageSize = 20,
// query to get pages
GetPages = List.Generate(
()=>0,
each _ < Param_NumberOfPages,
each _ + 1,
each [
get = Web.Contents(
"https://finviz.com/screener.ashx",
[
Query = [
v=Param_View,
f=Param_Filter,
o=Param_Order,
r=Text.From(
Param_Offset * Constant_PageSize
+ _ * Constant_PageSize + 1
)
]
]
),
// convert binary to html text for parsing
html = Text.FromBinary( get ),
// parse html into tabular data
// this relies on a particular html structure and is thus brittle
screener_headers = Html.Table(
html, {{"Headers","*"}},
[RowSelector="table.screener_table > thead th"]
)[Headers],
screener_fieldcount = List.Count(screener_headers),
screener_rows = List.Split(
Html.Table(
html, {{"Rows","*"}},
[RowSelector="table.screener_table tr td"]
)[Rows],
screener_fieldcount
),
screener_rowschema = Record.FromList(
List.Repeat({[Type=type text,Optional=false]},screener_fieldcount),
screener_headers
),
screener_tabletype = type table Type.ForRecord(screener_rowschema, false),
screener_table = Table.FromRows(screener_rows,screener_tabletype)
] [screener_table]
),
CombinePages = Table.Combine( GetPages )
in
CombinePages
Notes:
Hi @ZEPBCOB77 ,
I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.
Thank you.
Hi @ZEPBCOB77 ,
May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.
Thank you.
Hi @ZEPBCOB77 ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @MarkLaf @lbendlin for the prompt response.
I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.
Thank you.
All you need is to add r=start_row to your query. Here is a query with Offset and NumberOfPages parameters. I also incorporated parsing of the table - obviously this part can break easily if the underlying html gets changed in an update.
let
// screener data parameters
Param_View = "151",
Param_Filter = "ta_rsi_os40",
Param_Order = "ticker",
// screener paging parameters
Param_Offset = 2,
Param_NumberOfPages = 4,
// screener constants - do not change
Constant_PageSize = 20,
// query to get pages
GetPages = List.Generate(
()=>0,
each _ < Param_NumberOfPages,
each _ + 1,
each [
get = Web.Contents(
"https://finviz.com/screener.ashx",
[
Query = [
v=Param_View,
f=Param_Filter,
o=Param_Order,
r=Text.From(
Param_Offset * Constant_PageSize
+ _ * Constant_PageSize + 1
)
]
]
),
// convert binary to html text for parsing
html = Text.FromBinary( get ),
// parse html into tabular data
// this relies on a particular html structure and is thus brittle
screener_headers = Html.Table(
html, {{"Headers","*"}},
[RowSelector="table.screener_table > thead th"]
)[Headers],
screener_fieldcount = List.Count(screener_headers),
screener_rows = List.Split(
Html.Table(
html, {{"Rows","*"}},
[RowSelector="table.screener_table tr td"]
)[Rows],
screener_fieldcount
),
screener_rowschema = Record.FromList(
List.Repeat({[Type=type text,Optional=false]},screener_fieldcount),
screener_headers
),
screener_tabletype = type table Type.ForRecord(screener_rowschema, false),
screener_table = Table.FromRows(screener_rows,screener_tabletype)
] [screener_table]
),
CombinePages = Table.Combine( GetPages )
in
CombinePages
Notes:
Find the API provided by finviz and run your queries against that API. Screen scraping a dynamic HTML5 page will not be successful.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |