-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
70a3bc2
commit a4d8ed0
Showing
13 changed files
with
2,901 additions
and
572 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
{ | ||
"cSpell.words": [ | ||
"alphavantage", | ||
"AROON", | ||
"COMOD", | ||
"DEMA", | ||
"FXAIX", | ||
"MACDEXT", | ||
"ndxt", | ||
"STOCH", | ||
"STOCHF", | ||
"STOCHRSI", | ||
"TEMA", | ||
"TRIMA", | ||
"VFAIX", | ||
"WILLR", | ||
"yfinance" | ||
] | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,45 @@ | ||
import requests | ||
import pandas as pd | ||
from io import StringIO | ||
import re | ||
from bs4 import BeautifulSoup | ||
|
||
|
||
BASE = "https://cwe.mitre.org" | ||
URL = f"{BASE}/data/downloads.html" | ||
|
||
|
||
def main(): | ||
headers = { | ||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " | ||
"AppleWebKit/537.36 (KHTML, like Gecko) " | ||
"Chrome/91.0.4472.101 Safari/537.3" | ||
} | ||
# fname = f"{DATA_DIR}/500.csv" | ||
|
||
# if os.path.exists(fname): | ||
# logger.info("File exists %s", fname) | ||
# return | ||
|
||
# Fetch the page content | ||
response = requests.get(URL, headers=headers, timeout=30) | ||
|
||
# Use pandas to read the HTML tables | ||
tables = pd.read_html(response.text) | ||
table1 = tables[0] | ||
table2 = tables[1] | ||
table3 = tables[2] | ||
table4 = tables[3] | ||
print(table1, table2, table3, table4) | ||
# soup = BeautifulSoup(response.text) | ||
|
||
# for link in soup.findAll('a', attrs={'href': re.compile('.csv.zip')}): | ||
# fname = link.get("href").split('/')[-1] | ||
# link_abs = f'{BASE}{link.get("href")}' | ||
# print(link_abs) | ||
# with open(fname, 'wb') as f: | ||
# f.write(requests.get(link_abs).content) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Oops, something went wrong.