Micro Project
Micro Project
Microproject on
Submitted by
“Sawase.A.A”
2025-2026
CERTIFICATE
This is to Cerify that Naik Shaunak Mayur in Sixth Semester of Diploma in Computer
Science and Engineering has successfully completed the third year 2025-26 as prescribed in
Prof. Sawase.A.A
A web browser is an essential software application that allows users to retrieve, navigate, and
interact with content on the internet. Most modern web browsers come with advanced features,
including tabbed browsing, bookmarks, history tracking, and more.
In this project, we aim to develop a custom Python web browser with basic features using
PyQt5 and PyQtWebEngine. This will allow us to better understand the inner workings of web
browsers and implement features such as tab management, basic navigation, bookmarks, and
history tracking.
By building this web browser, we also explore GUI programming in Python, handling web
content, and managing user interaction.
2. Objective
o Build a web browser using Python with a GUI interface and implement key features
like tabs, bookmarks, and history tracking.
o Use PyQt5 to create a graphical user interface for the browser and handle
interaction events, such as button clicks, URL bar input, and tab switching.
o Learn about how web pages are displayed in a browser using PyQtWebEngine,
which enables embedding a web view inside the application.
o Build a base platform that can later be expanded with advanced features such as
downloads, extensions, and settings customization.
3. Functional Requirements
The Python Web Browser must implement the following core functionalities:
Tabs should be displayed at the top of the window, allowing users to open, close, and
switch between tabs easily.
Each tab should represent a different web page, allowing the user to browse multiple
websites simultaneously.
Forward Button: Users can go forward to the next page if they’ve previously navigated
backward.
Reload Button: Users can reload the current page to refresh it.
Users should be able to input URLs manually into a URL bar to navigate to any web
page.
The URL bar should automatically update as the user navigates between pages or tabs.
3.4 Bookmarks
Users should be able to save URLs as bookmarks for quick access in the future.
The browser should provide a bookmarks menu to view and access all saved bookmarks.
3.5 History
A history menu should display recently visited web pages, allowing users to revisit
previous pages.
Users should be able to open a new tab, close tabs, and switch between tabs easily.
The browser should display a default page (e.g., Google) when a new tab is opened.
4. Technologies Used
4.1 Python
Python is the programming language used to develop the core logic of the browser,
handle events, and manage web page rendering.
4.2 PyQt5
PyQt5 is a set of Python bindings for the Qt application framework. It is used for creating
the graphical user interface (GUI) of the web browser, including windows, buttons, and
input fields.
4.3 PyQtWebEngine
Qt Designer is a tool for designing graphical user interfaces for PyQt5 applications. It can
be used for designing the layout, though the design in this project was handled directly in
the Python code.
5. System Design
The Python Web Browser is designed to be simple and modular. It has the following
components:
The main window of the browser contains a QTabWidget for handling multiple tabs and
a QToolBar for navigation controls (back, forward, reload, home).
5.2 Tabs
The navigation bar consists of buttons for Back, Forward, Reload, and Home.
History and Bookmarks are stored as lists in the Python program, but they can be saved
to a database (like SQLite) for persistence.
The Bookmarks Dialog and History Dialog display a list of saved and visited URLs.
The system is event-driven, meaning it responds to user actions (e.g., button clicks, URL
bar input, tab switching) through signals and slots.
6. Development Phases
6.2 UI Design
Design the graphical interface, including the layout of the window, tabs, and navigation
bar.
Create the necessary buttons (back, forward, reload) and input fields (URL bar).
Implement basic features like tab creation, web page rendering, and URL navigation.
Develop the functionality for the navigation buttons (back, forward, reload, home).
6.5 Testing
Test the browser for basic functionality and fix any issues related to tabs, navigation, and
rendering.
Write user and developer documentation to explain how to use and extend the browser.
7. Source Code
import sys
import webbrowser
class WebBrowser(QMainWindow):
def __init__(self):
super().__init__()
self.browser_tabs = QTabWidget(self)
self.setCentralWidget(self.browser_tabs)
self.create_new_tab()
self.addToolBar(nav_bar)
# Back Button
back_button.triggered.connect(self.current_browser().back)
nav_bar.addAction(back_button)
# Forward Button
forward_button.triggered.connect(self.current_browser().forward)
nav_bar.addAction(forward_button)
# Reload Button
reload_button.triggered.connect(self.current_browser().reload)
nav_bar.addAction(reload_button)
# Home Button
home_button.triggered.connect(self.load_home_page)
nav_bar.addAction(home_button)
# URL Bar
self.url_bar = QLineEdit(self)
self.url_bar.returnPressed.connect(self.load_url_from_bar)
nav_bar.addWidget(self.url_bar)
new_tab_button.triggered.connect(self.create_new_tab)
nav_bar.addAction(new_tab_button)
# Bookmarks Button
bookmarks_button.triggered.connect(self.show_bookmarks)
nav_bar.addAction(bookmarks_button)
# History Button
history_button.triggered.connect(self.show_history)
nav_bar.addAction(history_button)
self.history = []
self.bookmarks = []
def create_new_tab(self):
browser = QWebEngineView()
browser.setUrl(QUrl('https://www.google.com'))
browser.urlChanged.connect(self.update_url)
self.browser_tabs.setCurrentWidget(browser)
def current_browser(self):
return self.browser_tabs.currentWidget()
def load_url_from_bar(self):
url = self.url_bar.text()
self.current_browser().setUrl(QUrl(url))
def update_url(self, q):
self.url_bar.setText(q.toString())
def load_home_page
(self): self.current_browser().setUrl(QUrl('https://www.google.com'))
def show_bookmarks(self):
bookmark_dialog = QDialog(self)
bookmark_dialog.setWindowTitle("Bookmarks")
layout = QVBoxLayout()
button = QPushButton(bookmark)
layout.addWidget(button)
bookmark_dialog.setLayout(layout)
bookmark_dialog.exec_()
def load_bookmark(self, bookmark):
self.current_browser().setUrl(QUrl(bookmark))
def show_history(self):
history_dialog = QDialog(self)
history_dialog.setWindowTitle("History")
layout = QVBoxLayout()
button = QPushButton(history_item)
layout.addWidget(button)
history_dialog.setLayout(layout)
history_dialog.exec_()
def load_history(self, history_item):
self.current_browser().setUrl(QUrl(history_item))
url = self.current_browser().url().toString()
self.history.append(url)
event.accept()
def add_to_bookmarks(self):
url = self.current_browser().url().toString()
self.bookmarks.append(url)