dhanoosu / trading212_scraper Goto Github PK
View Code? Open in Web Editor NEWPython based web scraping using selenium for extracting current portfolio holdings
Python based web scraping using selenium for extracting current portfolio holdings
# trading212_scraper Python based web scraping using selenium for extracting current portfolio holdings. - Currently only support Edge driver - Supports Python2.7 / Python3.1+ Trading212 is a great online broker for trading CFDs and stock investments. Although it has a built-in portfolio tracking of holdings, it is not very versatile. This script will help extract current holdings of `free_fund`, `account_value`, `market_value`, `buy_price`, `sell_price`, `ticker name` etc. - you can then export this to something like Google Sheets and make your custom Portfolio tracking. ## Installation and Pre-requisites Clone this tool by: git clone https://github.com/dhanoosu/trading212_scraper.git The followings are needed to be installed ``` $> pip install selenium $> pip install msedge-selenium-tools ``` ## Trading212 Setup Make sure the following show tabs setting are checked, and that 2 Factor-Authenication is disabled. <img src="img/show_tabs_settings.jpg" width="220"> ## Usage ```python from src.trading212_scraper import Scrape ``` Initialise a new class object, parsing in your username and password. `headless=True` allows the active window to be run in background. ```python trading212 = Scrape( username = <YOUR_USERNAME>, password = <YOUR_PASSWORD>, headless = <True/False> ) try: trading212.setup() trading212.scrape(account=<"ISA"/"INVESTING">) account_summary = trading212.get_account_summary() stocks = trading212.get_stocks() finally: #Gracefully exit the driver trading212.close_driver() ``` ## Known Issues - Once in a while, you might experience a `StaleElementException` - simply restart the script ## Support [![Buy me a coffee](https://img.shields.io/badge/-buy%20me%20a%20coffee-lightgrey?style=flat&logo=buy-me-a-coffee&color=FF813F&logoColor=white "Buy me a coffee")](https://www.buymeacoffee.com/dhanoosu) If you like this tool, consider [buying me a coffee](https://www.buymeacoffee.com/dhanoosu) to support the development of this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.