0% found this document useful (0 votes)
9 views23 pages

Micro Project

The document outlines a microproject on developing a Python web browser using PyQt5 and PyQtWebEngine, submitted by Naik Shaunak Mayur under the guidance of Prof. Sawase.A.A. It details the objectives, functional requirements, technologies used, system design, development phases, and includes source code for the browser. The project aims to create a simple web browser with features like tab management, bookmarks, and history tracking while learning GUI programming in Python.

Uploaded by

Shaunak Naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views23 pages

Micro Project

The document outlines a microproject on developing a Python web browser using PyQt5 and PyQtWebEngine, submitted by Naik Shaunak Mayur under the guidance of Prof. Sawase.A.A. It details the objectives, functional requirements, technologies used, system design, development phases, and includes source code for the browser. The project aims to create a simple web browser with features like tab management, bookmarks, and history tracking while learning GUI programming in Python.

Uploaded by

Shaunak Naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

ADITYA POLYTECHNIC BEED.

Microproject on

“Python web browser”

Submitted by

Naik Shaunak Mayur

Under the guidance of

“Sawase.A.A”

For the subject

“Programming with python”


(22616)

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

MSBTE curriculum under the guidance of subject teacher

Prof. Sawase.A.A

ENROLLMENT NO: 23511430123

NAME AND SIGNATURE OF GUIDE: ……………………………………………


ACKNOWLEDGEMENT
INDEX

SR.NO CONTENT PAGE.NO


INTRODUCTION

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

The primary objectives of the Python Web Browser project are:

1. Develop a simple web browser:

o Build a web browser using Python with a GUI interface and implement key features
like tabs, bookmarks, and history tracking.

2. Learn GUI programming:

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.

3. Implement core web browser functionalities:

o Develop features such as tab management, browser navigation (back, forward,


reload), URL input, history, and bookmarking of websites.

4. Understand how web content is rendered:

o Learn about how web pages are displayed in a browser using PyQtWebEngine,
which enables embedding a web view inside the application.

5. Create a platform for future improvements:

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:

3.1 Multiple Tab Support

 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.

3.2 Basic Navigation Controls

 Back Button: Users can navigate back to the previous page.

 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.

 Home Button: Users can return to a default homepage (e.g., Google).

3.3 URL Bar

 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

 The browser should keep a history of visited URLs.

 A history menu should display recently visited web pages, allowing users to revisit
previous pages.

3.6 Tab Management

 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

The following technologies and libraries were used in this project:

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

 PyQtWebEngine is a set of Python bindings for Qt WebEngine, which allows us to


embed web content (HTML, CSS, JavaScript) in our application. This is used to render
web pages inside the browser.

4.4 Qt Designer (Optional for UI Design)

 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:

5.1 Main Window

 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

 Each tab contains a QWebEngineView widget that renders a web page.

 QTabWidget allows the creation, closing, and switching between tabs.

5.3 Navigation Controls

 The navigation bar consists of buttons for Back, Forward, Reload, and Home.

 A QLineEdit (URL bar) is provided to manually enter URLs.

5.4 History and Bookmarks

 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.

5.5 Event-Driven Architecture

 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.1 Planning and Requirements Gathering


 Gather the functional requirements and determine which features need to be
implemented.

 Identify the libraries and technologies to be used (PyQt5, PyQtWebEngine).

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).

6.3 Core Functionality Implementation

 Implement basic features like tab creation, web page rendering, and URL navigation.

 Develop the functionality for the navigation buttons (back, forward, reload, home).

6.4 Bookmarks and History

 Add features to save bookmarks and track history.

 Implement the dialogs to show saved bookmarks and visited history.

6.5 Testing

 Test the browser for basic functionality and fix any issues related to tabs, navigation, and
rendering.

 Perform usability testing to ensure the interface is intuitive and responsive.


6.6 Deployment and Documentation

 Package the application into an executable for distribution.

 Write user and developer documentation to explain how to use and extend the browser.

7. Source Code

import sys

from PyQt5.QtCore import *

from PyQt5.QtWidgets import *

from PyQt5.QtWebEngineWidgets import *

from PyQt5.QtGui import *

import webbrowser

class WebBrowser(QMainWindow):

def __init__(self):
super().__init__()

self.setWindowTitle("Python Web Browser")

self.setGeometry(100, 100, 1200, 800)

# Create main layout

self.browser_tabs = QTabWidget(self)

self.setCentralWidget(self.browser_tabs)

# Add first tab

self.create_new_tab()

# Create Navigation Bar

nav_bar = QToolBar("Navigation Bar")

self.addToolBar(nav_bar)
# Back Button

back_button = QAction(QIcon('back_icon.png'), 'Back', self)

back_button.triggered.connect(self.current_browser().back)

nav_bar.addAction(back_button)

# Forward Button

forward_button = QAction(QIcon('forward_icon.png'), 'Forward', self)

forward_button.triggered.connect(self.current_browser().forward)

nav_bar.addAction(forward_button)

# Reload Button

reload_button = QAction(QIcon('reload_icon.png'), 'Reload', self)

reload_button.triggered.connect(self.current_browser().reload)

nav_bar.addAction(reload_button)
# Home Button

home_button = QAction('Home', self)

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)

# Add a new tab button

new_tab_button = QAction('New Tab', self)

new_tab_button.triggered.connect(self.create_new_tab)

nav_bar.addAction(new_tab_button)
# Bookmarks Button

bookmarks_button = QAction('Bookmarks', self)

bookmarks_button.triggered.connect(self.show_bookmarks)

nav_bar.addAction(bookmarks_button)

# History Button

history_button = QAction('History', self)

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.addTab(browser, "New Tab")

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()

if not url.startswith('http://') and not url.startswith('https://'):

url = 'http://' + url

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()

for bookmark in self.bookmarks:

button = QPushButton(bookmark)

button.clicked.connect(lambda b=bookmark: self.load_bookmark(b))

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()

for history_item in self.history:

button = QPushButton(history_item)

button.clicked.connect(lambda h=history_item: self.load_history(h))

layout.addWidget(button)

history_dialog.setLayout(layout)

history_dialog.exec_()
def load_history(self, history_item):

self.current_browser().setUrl(QUrl(history_item))

def closeEvent(self, event):

url = self.current_browser().url().toString()

self.history.append(url)

event.accept()

def add_to_bookmarks(self):

url = self.current_browser().url().toString()

if url not in self.bookmarks:

self.bookmarks.append(url)

if name == 'main': app = QApplication(sys.argv) window = WebBrowser() window.show()


sys.exit(app.exec_())

You might also like