diff --git a/src/mwfin/functions.py b/src/mwfin/functions.py index ac4022f..a1cd4cd 100644 --- a/src/mwfin/functions.py +++ b/src/mwfin/functions.py @@ -11,9 +11,6 @@ from bs4.element import ResultSet, Tag # the end dates of the reporting periods as strings (either years or quarters). ResultDict = dict[str, Union[tuple[int], tuple[str]]] -DOMAIN = 'www.marketwatch.com' -HTML_PARSER = 'html.parser' - async def soup_from_url(url: str, session: ClientSession = None) -> BeautifulSoup: """ diff --git a/tests/test_functions.py b/tests/test_functions.py index c0b0f06..6ed68dd 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -5,6 +5,12 @@ from bs4 import BeautifulSoup from mwfin import functions +# boiled down & accurate structure of a relevant data table +# https://www.marketwatch.com/investing/stock/aapl/financials/cash-flow +# view page source @ line 2055 +TEST_HTML = '' +TEST_SOUP = BeautifulSoup(TEST_HTML, 'html.parser') + class FunctionsTestCase(IsolatedAsyncioTestCase): @@ -26,19 +32,8 @@ class FunctionsTestCase(IsolatedAsyncioTestCase): self.assertEqual(expected_output, output) def test_extract_end_dates(self): - test_html = '
'Item' 'Item' |
+ End_Date_1 |
+ End_Date_2 |
+ |
---|---|---|---|
Item_1 Item_1 |
+ 11M |
+ (22M) |
+ |
Item_2 Item_2 |
+ 12% |
+ 13% |
+