A Python script for scraping stock data from Dhaka Stock Exchange (DSE) and Chittagong Stock Exchange (CSE) websites.
Please `Star` (⭐) the repository if you like the program ♥ ♥
Stock Watch Python Script is a tool that allows you to scrape stock data from the Dhaka Stock Exchange (DSE) and Chittagong Stock Exchange (CSE) websites. It fetches data such as the last trading price, closing price, day's range, volume, and more for a list of stocks provided in the stock_names.txt
file. The script utilizes web scraping techniques using the requests
, BeautifulSoup
, and tqdm
libraries.
- Scrapes stock data from DSE and CSE websites
- Provides information such as the last trading price, closing price, day's range, volume, and more
- Allows customization of data preferences
- Opens
stocknow.com.bd
for shareholding '%' changes (DSE only)
- Python 3.7, 3.8, or 3.9 installed
- Required Python packages:
requests
,beautifulsoup4
, andtqdm
. Install them using the following command:pip install requests beautifulsoup4 tqdm
- Clone the repository:
git clone https://github.com/MustakAbsarKhan/stock_watch_py_script.git
- Navigate to the project directory:
cd stock_watch_py_script
-
Prepare the
stock_names.txt
file:- Create a file named
stock_names.txt
in the project directory. - Add the trading codes of the stocks you want to fetch data for, with each code on a new line.
- Save the file.
- Create a file named
-
Run the script:
python main.py
-
Follow the prompts:
- If you wish to go with the default settings and see data from both DSE and CSE, type
y
and press Enter. - If you want to customize data preferences, type
n
and follow the instructions. - When prompted, you can choose to see data from DSE, CSE, or both.
- If you choose to see data from DSE, the script will open stocknow.com.bd for shareholding '%' changes.
- Press Enter to move to the next stock in the list.
- If you wish to go with the default settings and see data from both DSE and CSE, type
-
The script will display the extracted stock data for each stock in the console.
-
If you prefer using the executable file (
stock_watch.exe
) you can find it asstock_watch.zip
inside exe_file folder in the Repository. You can simply double-click on it to launch the program. The executable file eliminates the need for installing dependencies and running the script from the command line.
This project is licensed under the MIT License. See the LICENSE file for more information.