-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from finvizfinance.group.overview import Overview | ||
from finvizfinance.util import webScrap, imageScrap | ||
|
||
""" | ||
.. module:: group.spectrum | ||
:synopsis: group spectrum image. | ||
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
|
||
class Spectrum(Overview): | ||
"""Spectrum inherit from overview module. | ||
Getting information from the finviz group spectrum page. | ||
""" | ||
def __init__(self): | ||
"""initiate module | ||
""" | ||
self.BASE_URL = 'https://finviz.com/groups.ashx?{group}&v=310' | ||
self.url = self.BASE_URL.format(group='g=sector') | ||
Overview._loadSetting(self) | ||
|
||
def ScreenerView(self, group='Sector', order='Name', out_dir=''): | ||
"""Get screener table. | ||
Args: | ||
group(str): choice of group option | ||
order(str): sort the table by the choice of order | ||
""" | ||
if group not in self.group_dict: | ||
raise ValueError() | ||
if order not in self.order_dict: | ||
raise ValueError() | ||
self.url = self.BASE_URL.format(group=self.group_dict[group])+'&'+self.order_dict[order] | ||
|
||
soup = webScrap(self.url) | ||
url = 'https://finviz.com/' + soup.findAll('img')[5]['src'] | ||
imageScrap(url, group, '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
HERE = pathlib.Path(__file__).parent | ||
|
||
VERSION = '0.4' | ||
VERSION = '0.4.1' | ||
PACKAGE_NAME = 'finvizfinance' | ||
AUTHOR = 'Tianning Li' | ||
AUTHOR_EMAIL = '[email protected]' | ||
|