Mastering Data Extraction from OptionsPlay with Python

Birappa Goudanavar
Towards Data Engineering
2 min readNov 2, 2023

I created a data scraper using Python that collects data from optionsplay.com for CODA Analytics. This tool helped CODA Analytics make smarter choices and improve their strategies, leading to more money for them. This project shows how using data can make a big difference in making more money.

Photo by Igal Ness on Unsplash

Do you want to enhance the modern way of trading and making more profitable? Follow each step to understand and implement the code.

installing required modules using below command

pip install bs4, psycopg2, sqlalchemy, playwright

Creating functions for covered_calls, shortput, cread_spread. Implementing logic for each of the functions.

Implementing the function logic used in the above functions extract_data(), parse_data() and dump_data()

  • extract_data: This method will help to login using the credentials for optionsPlay and return the raw html elements.
  • parse_data: Identify the table elements and creates a dataframe.
  • dump_data: Load the data from csv files into postgres Database. Further connecting database to Visualisation tool to build a realtime dashboard.

Finally wrapping all methods into one function.

if __name__ == '__main__':
main_cread_spread()
main_shortput()
main_covered_calls()
# send_email()
time = datetime.datetime.now()
logger.info(f'Code Executed : {time}')

This logic will help you to extract the required information and further connect the postgres data to dashboard and build real-time analysis using charts and complex logics to make trading smooth and efficient.

Even you can automate this script to run frequently for free using Github Actions, So that dashboard will have real-time data.

I can help get the data you need and turn it into useful information that can make you more money. Just contact me on Upwork, and we’ll get started.

Let me know if face any problem in implementing this logic in comments. Thanks

--

--