|
27 | 27 | # noinspection PyAttributeOutsideInit
|
28 | 28 | class Nse:
|
29 | 29 | version: str = '5.2'
|
30 |
| - beta: Tuple[bool, int] = (True, 12) |
| 30 | + beta: Tuple[bool, int] = (True, 13) |
31 | 31 |
|
32 | 32 | def __init__(self, window: Tk) -> None:
|
33 | 33 | self.intervals: List[int] = [1, 2, 3, 5, 10, 15]
|
@@ -76,9 +76,17 @@ def __init__(self, window: Tk) -> None:
|
76 | 76 | self.login_win(window)
|
77 | 77 |
|
78 | 78 | def get_symbols(self) -> None:
|
79 |
| - symbols_information: requests.Response = requests.get(self.url_symbols, headers=self.headers) |
| 79 | + try: |
| 80 | + symbols_information: requests.Response = requests.get(self.url_symbols, headers=self.headers) |
| 81 | + except Exception as err: |
| 82 | + print(err, sys.exc_info()[0], "19") |
| 83 | + sys.exit() |
80 | 84 | symbols_information_soup: bs4.BeautifulSoup = bs4.BeautifulSoup(symbols_information.content, "html.parser")
|
81 |
| - symbols_table: bs4.element.Tag = symbols_information_soup.findChildren('table')[0] |
| 85 | + try: |
| 86 | + symbols_table: bs4.element.Tag = symbols_information_soup.findChildren('table')[0] |
| 87 | + except IndexError as err: |
| 88 | + print(err, sys.exc_info()[0], "20") |
| 89 | + sys.exit() |
82 | 90 | symbols_table_rows: List[bs4.element.Tag] = list(symbols_table.findChildren(['th', 'tr']))
|
83 | 91 | symbols_table_rows_str: List[str] = ['' for _ in range(len(symbols_table_rows) - 1)]
|
84 | 92 | for column in range(len(symbols_table_rows) - 1):
|
|
0 commit comments