You are on page 1of 18

Web Browser Using Python

Submitted ByChatanya Mahajan(1031310688)


Tithi Nikhita(1031310730)
Saikat Sinha(1031310709)

Department of Computer Science Engineering


SRM University, Kattankulathur
April 2015

ABSTRACT
Web browser is the most commonly
used client application and speed
and efficiency of our online work
depends on browser to a great
extent. As the market is flooding
with new browsers there is a lot of
confusion in everyones mind as to
which is the best browser. Our
project aims to answer this question.

INTRODUCTION
The World Wide Web has come a long
way in its short existence. Without it,
many people wouldnt know what to
do with their day. And others literally
couldnt survive without it. To browse
the internet we use browser. A
browser provides a user interface for
displaying and selecting items from a
list of data or from hierarchically
organized lists of data such as

WHY ARE WEB BROWSERS SO


IMPORTANT?
Today most of what we use the web
for isnt just web pages, they are
applications. Users upload download
videos, chat, play online games, and
use many other web services.
Web browser is becoming more and
more important as an application
used to conduct billions of dollars of
Internet-enabled commerce each
year.

Tools/Software used
Python Programming Language
Pythonis a widely usedgeneralpurpose,high-level programming
language.Its design philosophy
emphasizes code readability, and its
syntax allows programmers to
express concepts in fewerlines of
codethan would be possible in
languages such asC++orJava.

Tools/Software used
PYQT Framework
PyQt is one of the two most popular Python
bindings for the Qt cross-platform
GUI/XML/SQL C++ framework (another
binding isPySide). PyQt developed by
Riverbank Computing Limited. Qt itself is
developed as part of theQt Project. PyQt
provides bindings for Qt 4 and Qt 5. PyQt is
distributed under achoice of licences: GPL
version 2, GPL version 3, or a commercial
license.

Tools/Software used
QT Designer
Qt Designer is the Qt tool for designing and
building graphical user interfaces. It allows
you to design widgets, dialogs or complete
main windows using on-screen forms and a
simple drag-and-drop interface. It has the
ability to preview your designs to ensure
they work as you intended, and to allow you
to prototype them with your users, before
you have to write any code.

Steps Followed while developing the WEB


BROWSER

Installing the required


packages/Softwares

1.Python
2.PYQT for Python
3.QT Designer

Steps Followed while developing the WEB


BROWSER

Creating UI with QT Designer


1. Select Main Window and press
Create. We now have our designer
window open.
2. Drag aKWebViewcomponent on the
window.
3. We also add anLine Editon top.
Press File > Save As > browser.ui.

Steps Followed while developing the WEB


BROWSER

Steps Followed while developing the WEB


BROWSER
Creating the logic
Create a file calledrun.pywith this contents:
import sys
from browser import BrowserDialog
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import QUrl
from PyQt4.QtWebKit import QWebView

class MyBrowser(QtGui.QDialog):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
QWebView.__init__(self)
self.ui = BrowserDialog()
self.ui.setupUi(self)
self.ui.lineEdit.returnPressed.connect(self.loadURL)

def loadURL(self):
url = self.ui.lineEdit.text()
self.ui.qwebview.load(QUrl(url))
self.show()
#self.ui.lineEdit.setText("")

if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = MyBrowser()
myapp.ui.qwebview.load(QUrl('http://www.talkera.org/python'))
myapp.show()
sys.exit(app.exec_())

Steps Followed while developing the WEB


BROWSER

This code will use the UI as defined in


browser.py and add logic to it. The
lines
self.ui.lineEdit.returnPressed.connect(self.loadURL)
def loadURL(self):
url = self.ui.lineEdit.text()
self.ui.qwebview.load(QUrl(url))
self.show()
#self.ui.lineEdit.setText("")

OUTPUT

Making sure we type the full url, e.g. : http://python.org including


the http:// part. The browser should now start:

Drawbacks
Javascript files will not be executed
Videos working with HTML5 and Flash
will not work
Fonts may not function properly
sometimes.

SUMMARY
Web browsers allows a user to quickly and easily
access information provided on many web pages
at many web sites by traversing these links. A
browser provides a user interface for displaying
and selecting items from a list of data or from
hierarchically organized lists of data such as
directory paths. We can tell that browser is the
most commonly used client side application.

SUMMARY
A web browser is client side application program that
contacts remote servers and retrieves documents from
it and displays them on screen, either within the
browser window itself or by passing the document to an
external helper application. We have developed our
own browser using python, PYQT Framework and QT
Designer. We created a browser.ui file by following
some simple steps and then we executed a run.py
program in python. This Web browser can be used to
access any website using their URL. But the URLs has
to be entered manually. It has few drawbacks such as
various fonts, few video formats and Javascript files
may not function properly.

REFERENCE
http://en.wikipedia.org/wiki/Python_%28progra
mming_language%29
https://pythonspot.com/creating-a-webbrowser-wit
h-python-and-pyqt-tutorial/
PYQT 5 Reference Guide
http://pyqt.sourceforge.net/Docs/PyQt4/designer.h
tml
http://doc.qt.io/qt-4.8/designer-manual.html
http://python.org
Python Programming: An Introduction to
Computer Science, 2nd Ed.
https://wiki.python.org/moin/PyQt

You might also like