Skip to content

Instantly share code, notes, and snippets.

@Birappa87
Created November 2, 2023 19:46
Show Gist options
  • Select an option

  • Save Birappa87/8d4cc8592f6659937d230a1606b2c9e7 to your computer and use it in GitHub Desktop.

Select an option

Save Birappa87/8d4cc8592f6659937d230a1606b2c9e7 to your computer and use it in GitHub Desktop.
Main Logic
def main_covered_calls():
try:
urls = {
'coveredCalls' : 'https://www.optionsplay.com/hub/covered-calls'
}
html = extract_data(url=urls['coveredCalls'], choice='coveredCalls')
data = parse_data(html, choice='coveredCalls')
data.to_csv('data/covered_calls.csv')
dump_data(df=data, choice='coveredCalls', index=False)
except Exception as err:
print(err)
def main_shortput():
try:
urls = {
'shortPuts' : 'https://www.optionsplay.com/hub/short-puts'
}
html = extract_data(url=urls['shortPuts'], choice='shortPuts')
data = parse_data(html, choice='shortPuts')
data.to_csv('data/shortput.csv')
dump_data(df=data, choice='shortPuts', index=False)
except Exception as err:
print(err)
def main_cread_spread():
try:
urls = {
'CreditSpreadFile' : 'https://www.optionsplay.com/hub/credit-spread-file'
}
html = extract_data(url=urls['CreditSpreadFile'], choice='CreditSpreadFile')
data = parse_data(html, choice='CreditSpreadFile')
data.to_csv('data/credit_spread.csv', index=False)
dump_data(df=data, choice='CreditSpreadFile')
except Exception as err:
print(err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment