0% found this document useful (0 votes)
17 views29 pages

Aditya Polytechnic Beed: Microproject On

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 provide insights into GUI programming, web content handling, and the overall workings of web browsers.

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)
17 views29 pages

Aditya Polytechnic Beed: Microproject On

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 provide insights into GUI programming, web content handling, and the overall workings of web browsers.

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/ 29

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

I would like to express my sincere gratitude to everyone who has contributed to the
successful completion of this microproject on PYTHON WEB BROWSER.

Firstly, I would like to extend my heartfelt thanks to [PROF.SHAIKH.S.I], my project guide,


for their valuable guidance, unwavering support, and continuous encouragement throughout
the course of this project. Their expertise and suggestions have been instrumental in shaping
this work.

I would also like to express my gratitude to [PROF.SAWASE.A.A] of the [COMPUTER


SCIENCE AND ENGINEERING], for their constant motivation and insightful feedback,
which helped me in improving the quality of this report.

My sincere thanks to all the staff members, engineers, and technicians in the thermal power
plants who provided their time and shared their knowledge on safety management systems,
making this project more practical and informative.
INDEX

SR.NO CONTENT PAGE.NO

1 INTRODUCTION

2 OBJECTIVE

3 FUNCTIONAL
REQUIREMENTS

4 TECHNOLOGIES
USED

5 SYSTEM DESIGN

6 DEVELOPMENT
PHASES

7 SOURCE CODE

8 SNAPSHOTS

9 REFERENCE

10 CONCLUSION
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:

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_())
8. SNAPSHOTS
9.REFERENCE

 Python Documentation (Official)

 Python’s official documentation is a great place to understand the core libraries used in
the creation of a simple web browser. Libraries like webbrowser, tkinter, requests, and
BeautifulSoup (for scraping or browsing automation) are useful for building web browser
functionality.

 Official Python Docs

 Tkinter Documentation (for GUI)

 Tkinter is a Python library used for creating simple graphical user interfaces (GUIs). In
building a simple web browser, Tkinter can be used to design the interface where users
can enter URLs and interact with the page.
 Tkinter Documentation

 PyQt5 Documentation

 PyQt5 is another option for building more complex GUI applications in Python. For a
more advanced, feature-rich web browser, you can explore PyQt5, which integrates the
QtWebEngine to embed a web rendering engine.

 PyQt5 Documentation

 Requests Library

 The requests library is crucial for making HTTP requests, which is part of how web
browsers retrieve content from servers. You can learn how to send GET/POST requests
and process responses.

 Requests Documentation

 Web Scraping with BeautifulSoup

 If your project involves extracting data from the web, BeautifulSoup is a great tool for
parsing HTML and XML documents. It’s commonly used to extract information from
web pages.

 BeautifulSoup Documentation

 Using Selenium for Browser Automation

 Selenium is useful if you want to automate web browsing, such as simulating clicks,
typing, and other browser interactions. It can be used for web testing and scraping as
well.
 Selenium Documentation

 Open-source Projects for Inspiration

 Browsing open-source projects on GitHub for Python web browsers or simple web apps
can provide valuable insights and templates. Many Python-based browsers are open-
source and provide good reference points.

 Example: Python Web Browser on GitHub

10.CONCLUSION

In conclusion, creating a web browser in Python is an exciting and educational project


that offers insights into several fundamental programming concepts such as GUI development,
web requests, and data parsing. By leveraging Python libraries like Tkinter, PyQt5, requests,
and BeautifulSoup, or even browser automation tools like Selenium, it is possible to build a
functional and interactive web browser. This project not only reinforces Python programming
skills but also provides exposure to web technologies and how browsers interact with websites.

While the project can start with a basic browser, it can be expanded to include features such as
tabbed browsing, history management, and more advanced web scraping techniques. The
overall experience of building a Python web browser enhances understanding of client-server
architecture and the structure of web applications. With sufficient knowledge and effort, this
project could lay the groundwork for more complex web-related projects, including web
automation tools, bots, or even custom browsers tailored to specific needs.
This microproject demonstrates the power of Python in developing practical applications and
encourages further exploration into the world of web technologies and GUI design

You might also like