This project serves as an automated way to download all available historic market prices of a stock from ariva.de and saves them as a CSV file in a format intended for uploading it to PortfolioPerformance.
-
Create an account on ariva.de and use these credentials when executing the script.
-
Make sure you have Python3, Firefox and Xvfb installed on your system. This project is designed to run on Linux.
-
Checkout the project
git clone https://github.com/StegSchreck/HistoricMarketPriceDownloader.git && cd HistoricMarketPriceDownloader
-
Install the requirements with pip for Python3
pip3 install -r requirements.txt
-
Install Geckodriver
- Use your system's package manager (if it contains Geckodriver)
- Arch Linux:
pacman -S geckodriver
- MacOS:
brew install geckodriver
- Arch Linux:
- Or execute
sudo ./InstallGeckodriver.sh
. For this you will need to have tar and wget installed.
- Use your system's package manager (if it contains Geckodriver)
After ensuring that you met the preconditions, you can simply run the following command in your terminal using the ISIN of the stock you want to parse:
python3 main.py --isin <isin> --username <username_or_email> --password <password>
-i
/ --isin
: ISIN of the stock. You can define multiple ISINs to be considered by setting multiple -i
parameters. If you additionally define a marketplace using -m
, it will be attempted to use for all ISINs.
-u
/ --username
: username or email for ariva login
-p
/ --password
: password for ariva login
-m
/ --market_place
: Name of the marketplace to use. If given marketplace is not available, the default selection on the site is used. If you define a multiple ISINs using -s
, the marketplace defined here will be attempted to be used for all ISINs.
-d
/ --destination
: destination folder for the resulting CSV file containing the parsed data - independent from -f
/--filename
-f
/ --filename
: filename for the result CSV - independent from -d
/--destination
-v
/ --verbose
: increase output verbosity (i.e. print the generated predictions in the console)
-x
/ --show_browser
: show the browser doing his work (this might help for debugging)
-h
/ --help
: Display the help, including all possible parameter options
This happens because an advertisement is obscuring the button to click for saving the predictions.
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <input name="submitbutton" type="submit"> is not clickable at point (354,523.0666656494141) because another element <iframe id="google_ads_iframe_/39752343/leaderboard_1_0" name="" src="https://tpc.googlesyndication.com/safeframe/1-0-29/html/container.html"> obscures it
If you experience this, we can recommend using the -x
option, which will display the Firefox browser doing the action.
If you recently updated your Firefox, you might encounter the following exception during the login attempt of the parser:
selenium.common.exceptions.WebDriverException: Message: Expected [object Undefined] undefined to be a string
This can be fixed by installing the latest version of Mozilla's Geckodriver by running again the Install Geckodriver command mentioned above.