mariostoev/finviz

Using custom screener url

Closed this issue · 2 comments

Is there a way I can use the library to extract the tickers from a custom screener url?

On finviz, I am using this url:

https://finviz.com/screener.ashx?v=211&s=ta_topgainers&f=sh_curvol_o1000,sh_price_o3,sh_relvol_o1&ft=4&ta=0

I would like to extract all of the tickers that are shown.
I tried using Screener:

Screener.init_from_url(url="https://finviz.com/screener.ashx?v=211&s=ta_topgainers&f=sh_curvol_o1000,sh_price_o3,sh_relvol_o1&ft=4&ta=0")

but got the following error:

raise InvalidTableType(split_query["v"][0])
finviz.helper_functions.error_handling.InvalidTableType: Invalid table type called: 211

v=211 is a non tabular data --> not supported
you can try changing to 121 and it will work. i.e.
https://finviz.com/screener.ashx?v=121&s=ta_topgainers&f=sh_curvol_o1000,sh_price_o3,sh_relvol_o1&ft=4&ta=0

Though this filter was empty so I removed the Current Volume Over 1M (sh_curvol_o1000) filter to run:
https://finviz.com/screener.ashx?v=121&s=ta_topgainers&f=sh_price_o3,sh_relvol_o1&ft=4&ta=0

@dshohat thank you, that works