This is a Python program to extract data about materials and how to recycle them. 🌿The data is in swedish and gathered from a swedish website. The extracted data is displayed in a simple Flutter application. 📱
Python 2.6, 2.7 or 3.3+, Selenium and Chromedriver is used to scrape the information.
Sqlite3 is used to store the gathered data in a SQLite database.
Firebase Realtime Database and firebase_admin can also be used to store the data.
Flutter is used for the mobile application.
Clone the project and run following command from within the project directory:
python ./recycle_info_scraper/scraper.py
This starts the script which will scrape the web page for information and store it in a database. Change the main
function to choose database type, see below.
The application uses a Firebase Realtime Database to display data. This must be set up before running the app. After set up, make sure you are in the right directory and start the flutter application with the following commands:
cd ./recycle_app
flutter pub get
flutter run
Note: You need to have flutter installed and a simulator running or a phone connected. More info HERE.
A SQLite database can be used to store the data. The setup currently consists of 6 tables in the database:
RECYCLEABLES (ID, NAME, TYPE)
SYNONYMS (ID, NAME)
TYPES (ID, NAME)
RECYCLE_PLACES (ID, NAME)
ALL_HAZARDUOS_MATERIALS (ID, NAME)
ASSOCIATED_HAZARDUOS_MATERIALS (ITEM, MATERIAL)
The NoSQL database provided by Firebase can also be used. A Firebase project must then be created, and credentials provided and incorporated into the project. Change the path in the init
function in the firebase_connect.py
file.