Fetch fund data from avanza.se using Python and some web scraping with bs4

Overview

Py(A)vanza

Fetch fund data from avanza.se using Python and some web scraping with bs4. The default way is to display the data in the terminal, apply --json for json output.

Tux, the Linux mascot

How does it work?

Provide this script with the fund id (can be found in the url of the fund, example below). The script is scraping the funds page and displays the output.

How is this useful?

You can use this data for your own project, perhaps on a Raspberry Pi with a display?

Installation

We're going to use selenium with chrome driver for this one. So apt install chromium-chromedriver and xvfb.

$ sudo apt install chromium-chromedriver
$ sudo apt install xvfb

Next, clone repo and install requirements (preferably inside a virtualenv of some sort).

$ git clone 
   
    
$ mkvirtualenv pyvanza
$ pip install -r requirements.txt

   

Grab the fund id from url. In this case the id is 325406.

URL: https://www.avanza.se/fonder/om-fonden.html/325406/spiltan-aktiefond-investmentbolag

Running script

Argument Required Description
id Yes Fund id is mandatory
--json No Output will be in json format
--nocolors No Terminal colors will be disabled
(pyvanza) [email protected]:~ $ python pyvanza.py 693994
┌──────────────────────────────────────┐
│  Spiltan Globalfond Investmentbolag  │
└──────────────────────────────────────┘
┌──────┬─────────┐
│ Time │ Change  │
├──────┼─────────┤
│ 1 m. │ −2,82%  │
│ 3 m. │ +1,54%  │
│ i år │ −3,84%  │
│ 1 år │ +26,21% │
│ 3 år │ +55,97% │
│ 5 år │ +70,65% │
│ Max  │ +87,05% │
└──────┴─────────┘
(pyvanza) [email protected]:~ $ python pyvanza.py 693994
{
  'title': ' Spiltan Globalfond Investmentbolag ',
  'data': {
     '1 m.': '−2,82%',
     '3 m.': '+1,54%',
     'i år': '−3,84%',
     '1 år': '+26,21%',
     '3 år': '+55,97%',
     '5 år': '+70,65%',
     'Max': '+87,05%'
 }
}
Owner
dunderrrrrr
dunderrrrrr
An advanced Filter Bot with nearly unlimitted filters

Telegram MTProto API Framework for Python Documentation • Releases • Community Pyrogram from pyrogram import Client, filters app = Client("my_account

Pyrogram 3.2k Jan 05, 2023
Notion4ever - Python tool for export all your content of Notion page using official Notion API

NOTION4EVER Notion4ever is a small python tool that allows you to free your cont

50 Dec 30, 2022
Cytotron - A unique discord bot like never before. Add it to your server to keep it active, motiviated, and amazing!!

Cytotron - Take your server to the next level Most of the details are in the website. Go to https://cytotron-bot.gq for more information. If that link

LeviathanProgramming 6 Jun 13, 2021
Python package and CLI for user-friendly integration with SAS Viya

sasctl A user-friendly Python interface for SAS Viya. Full documentation: https://sassoftware.github.io/python-sasctl Table of Contents Overview Prere

SAS Software 30 Dec 14, 2022
Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado sistema ou programa.

LoginPy Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado si

Jonas Carvalho 4 Dec 23, 2021
Celestial - a Python regex Discord chatbot who can talk with you.

Celestial a Python regex Discord chat bot who can talk with you. Invite url: https://discord.com/api/oauth2/authorize?client_id=927573556961869825&per

Jirayu Kaewsing 3 Jan 01, 2023
b2blaze

b2blaze Welcome to the b2blaze library for Python. Backblaze B2 provides the cheapest cloud object storage and transfer available on the internet. Com

George Sibble 603 Jan 03, 2023
This bot will automatically like and follow users that post under a specified hashtag

Instagram-bot This bot will automatically like and follow users that post under a specified hashtag Dependencies Java JDK Selenium Updated version of

Makana Edwards 1 Nov 04, 2021
A Python Library to Make Quote Images

Quote2Image A Python Library to Make Quote Images How To Use? Download The Latest Package From Releases Extract The Zip File And Place Every File In I

Secrets 28 Dec 30, 2022
Scheduled Block Checker for Cardano Stakepool Operators

ScheduledBlocks Scheduled Block Checker for Cardano Stakepool Operators Lightweight and Portable Scheduled Blocks Checker for Current Epoch. No cardan

SNAKE (Cardano Stakepool) 4 Oct 18, 2022
A GUI Application that creates a Spotify Playlist from any year in the past, by just entering your preferred date

A GUI Application that creates a Spotify Playlist from any year in the past, by just entering your preferred date

David .K. Danso 1 Jan 17, 2022
Versatile async-friendly library to retry failed operations with configurable backoff strategies

riprova riprova (meaning retry in Italian) is a small, general-purpose and versatile Python library that provides retry mechanisms with multiple backo

Tom 108 Apr 27, 2022
Definitive Guide to Creating a SQL Database on Cloud with AWS and Python

Definitive Guide to Creating a SQL Database on Cloud with AWS and Python An easy-to-follow comprehensive guide on integrating Amazon RDS, MySQL Workbe

Kenneth Leung 6 Aug 17, 2022
This project uses Youtube data API's to do youtube tags analysis based on viewCount, comments etc.

Youtube video details analyser Steps to run this project Please set the AuthKey which you can fetch from google developer console and paste it in the

1 Nov 21, 2021
One destination for all the developer's learning resources.

DevResources One destination for all the developer's learning resources. Find all of your learning resources under one roof and add your own. Live ✨ Y

Gaurav Sharma 33 Oct 21, 2022
Enables you to execute scripts and perform API requests in MikroTik router

HomeAssistant component: MikroTik API The mikrotik_api platform enables you to execute scripts and perform API requests in MikroTik router To enable M

Pavel S 6 Aug 12, 2022
A project that automatically sends you a Medium article on a topic of your choosing to your email address daily.

Daily Article from Medium ✏️ About A project that automatically sends you a Medium article on a topic of your choosing to your email address daily. No

Orhan Emre Dikicigil 2 Apr 27, 2022
Download nitro generator that generates free nitro code that you can use for Discord

Download nitro generator that generates free nitro code that you can use for Discord, run it and wait for free nitro to come

Umut Bayraktar 154 Jan 05, 2023
This is RequestTrackerBot and it used for tracking request made by user in a group

This is a Request Tracker Bot repo, It is for those who upload content like movies, anime, etc. It can be used for tracking request of content that your members asked for.

Abhijeet 27 Dec 29, 2022
Python 3 SDK/Wrapper for Huobi Crypto Exchange Api

This packages intents to be an idiomatic PythonApi wrapper for https://www.huobi.com/ Huobi Api Doc: https://huobiapi.github.io/docs Showcase TODO Con

3 Jul 28, 2022