Professional Documents
Culture Documents
Final Project
Final Project
Final Project
ABHISHEK KUMAR
194708894
MCSP-060
Under Guidance of
This is to certify that the project report entitled Product Price Comparison
among E-Commerce Sites submitted to Indira Gandhi National Open University
in partial fulfillment of the requirement for the award of the degree of MASTER
OF COMPUTER APPLICATIONS (MCA) is an authentic and original work
carried out by Mr. Abhishek Kumar with enrolment no. 194708894 under my
guidance.
The matter embodied in this project is genuine work done by the student and
has not been submitted whether to this University or to any other University /
Institute for the fulfillment of the requirements of any course of study.
………………………. ...…………………….
Signature of the Student: Signature of the Counsellor
Date:
Acknowledgement
Commerce Sites” project and take this opportunity to express our profound
We thank our college for providing us with excellent facilities that helped us
to complete and present this project. We express our deepest gratitude towards our
project guide for his/her valuable and timely advice during the various phases in
our project. We would also like to thank him/her for providing us with all proper
facilities and support as the project co-coordinator. We would like to thank him/her
for support, patience and faith in our capabilities and for giving us flexibility in
We would like to thank all our friends for their smiles and friendship making
the college life enjoyable and memorable and family members who always stood
beside us and provided the utmost important moral support. Finally, we would like
PROJECT SYNOPSIS
6
PROJECT REPORT
7
TABLE OF CONTENT
Sr. No. Contents
1 PROJECT OVERVIEW
8
1.1 Introduction
1.2 Objective, Purpose and Scope
2 SYSTEM ANALYSIS
2.1 Identification of the Need
2.2 Preliminary Investigation
2.3 Feasibility Study.
2.4 Project Planning and Scheduling
PERT Chart
Gantt Chart
Flow Graph
2.5 Software, Hardware and Tools Requirement
2.6 Survey of Technologies used.
3 PROJECT DESIGN
3.1 Project Life Cycle Details
3.2 ER-Diagram
3.3 Use Case Diagram
3.4 Sequence Diagram
3.5 Activity Diagram
3.6 Class Diagram
3.7 DFD
3.8 System Architecture
3.9 Data Dictionary
4 CODING
5 STANDARDISATION OF CODING
5.1 Code Efficiency
5.2 Error Handling
5.3 Parameter Calling and Passing
5.4 Validation check
5.5 Coding Standards
6 TESTING
6.1 Unit Testing
6.2 Integration Testing
6.3 Validation Testing
6.4 Output Testing
6.5 User Acceptance Testing
6.6 Test Cases
1. PROJECT OVERVIEW.
1.1 Introduction.
1.2.2 Purpose. Now people like doing online shopping. There are
many different shopping sites having different prices. Price
comparison is done when the price of the same product is compared
in different outlets. There are many online shopping sites which are
being used to shop various products online. It is a very time
consuming process to visit on every site, select your desired product,
compare the specification and then further check prices at different
sites. To ease this lengthy process, this project will required to select
the desired product at once on as many sites you want to explore then
the rest processes from finding the lowest price till placing the order
will get automated.
11
2. SYSTEM ANALYSIS.
There are many online shopping sites which are being used to shop
various products online and with different prices.
While purchasing any product people go and look for the same
product on different sites manually, then compare price and
purchase from cheap price site.
Technical Feasibility
Languages : python
Economic Feasibility
Operational Feasibility
The proposed system will not cause any problem under any
circumstances. This project is operationally feasible because the time
requirements and personnel requirements are satisfied.
17
(c) The code shall run and fetch the item description,
availability and price of the specified item on each mentioned
site and inform the user bout the lowest price and its
corresponding site.
(d) The user will be asked for username and password and
then the system will automatically add the item with lowest
price into the cart and process the order.
18
PERT CHART
TASKS W1 W2 W3 W4 W5 W6 W7 W8 W9
Project Requirement
Available Technology
Uses Cases Finalisation
Milestone
Coding
Testing Platform
Testing
Milestone
Recoding
Standardization of Code
Documentation
Milestone
Note:
Available Technology : One month was invested in learning the technology.
19
Flow Graph
M1 M2
M3 M4 M5
M6
End M7
GANTT Chart
Note: The Project has been coded using python and selenium, so a lot of time was
spent if finalizing the backend software and front end. Django and Selenium was
two candidates and later selenium was selected due to its rich inbuilt library and
less time complexity.
Testing of the code was done parallel using dummy sites available as open and
free source. Later the tested code were run on the real time E-Commerce Sites.
21
Hardware Requirement.
(a) Laptop or PC
(b) I3 processor system or higher
(c) 4 GB RAM or higher
(d) 100 GB ROM or higher
Software Requirement.
(a) Laptop or PC
(b) Windows 7 or higher
(c) XAMP or WAMP Server
(d) Python
(e) Django/Selenium Framework
(f) MySql Database
(g) Text Editor (Notepad++ / Sublime Text)
Interface Requirements.
You can freely use and distribute Python, even for commercial use.
Not only can you use and distribute software’s written in it, you
can even make changes to the Python's source code.
Python has a large community constantly improving it in each
iteration.
Portability.
You can move Python programs from one platform to another, and
run it without any changes. It runs seamlessly on almost all
platforms including Windows, Mac OS X and Linux.
Unlike C/C++, you don't have to worry about daunting tasks like
memory management, garbage collection and so on.
Likewise, when you run Python code, it automatically converts
your code to the language your computer understands. You don't
need to worry about any lower-level operations.
24
Object-oriented.
3. Project Design.
Waterfall Model
Gender Name
Address
Mobile No.
Register
Email id
User id
Password
has
Search Product
Password
id Price Compared
LOGIN
SEARCH
PRODUCT
PRICE
COMPARE
ADD WISHLIST
PLACE ORDER
LOGOUT
19. Acknowledge ()
19. Successful
20. Successful
21. Successful
Login
If authentication
is successful Order
placed.
User
approval
Exit
Item added
to cart
Price
Fetch data
Compared
New Registration
User
- Name : String
- User_id : String - DOB : Int
- Password : String - Gender : String
- Address : String
+ Login()
- Mobile No.: Int
+ btn_Click ()
- Email id : String
+ Logout ()
- User id : String
- Password : String
+ Submit ()
+ btn_Click ()
31
1.0
Process Invalid Password
User
Req
uest
Username and password
Product and sites detail
Product and sites detail Product X Path
0.0 User need
User 1.1
Product Price E-commerce
Comparison
Website Project DB Sites
Feedback For
Process Sites
User Data
Lowest Product price Product prices and
with site Detail
Lowest Product price with site Detail Description
Product prices and
1.2 Description
Place the Order
User Process
Req
uest
Consent, user-id and
Password for the site
DATABASE DETAIL
33
LEVEL 1 DFD
Place order
34
1. In each form, no field which is not null able should be left blank.
2. All numeric fields should be checked for non-numeric values.
3. Text fields like names should not contain any numeric characters.
4. All primary keys should be automatically generated to prevent the
user from entering any existing key.
5. Use of error handling for each Save, Edit, delete and other
important operations.
6. Whenever the user Tabs out or Enter from a text box, the data
should be validated and if it is invalid, focus should again be sent to
the text box with proper message.
35
4. Coding.
import time
options=Options()
options.add_experimental_option("detach", True)
driver = webdriver.Chrome(options=options)
def extract_price(text):
price_str = ""
text_split = text.split(".")
for char in text_split[0]:
try:
int(char)
price_str += char
except Exception as e:
continue
return int(price_str)
37
flipkart_item_name=driver.find_element(By.XPATH,
"/html/body/div[1]/div/div[3]/div[1]/div[2]/div[2]/div/div[1]/h1/span").text
flipkart_item_cost=driver.find_element(By.XPATH,
"/html/body/div[1]/div/div[3]/div[1]/div[2]/div[2]/div/div[4]/div[1]/div/
div[1]").text
flipkart_price = extract_price(flipkart_item_cost)
flipkart_item_description=driver.find_element(By.XPATH,
"/html/body/div[1]/div/div[3]/div[1]/div[2]/div[8]/div[1]/div/div[2]").text
38
print(flipkart_item_description)
driver.get('https://shop.gadgetsnow.com/smartphones/apple-iphone-12-256-gb-
black-4-gb-ram-/10021/p_G201794?
gad_source=1&gclid=EAIaIQobChMI7qbuw8zmhAMVe6tmAh3FjgmEEAQYAi
ABEgLWwfD_BwE')
gadgetnow_item_name=driver.find_element(By.XPATH,
"/html/body/div[1]/div[2]/div[5]/div[1]/div/div[1]/div[1]/h1").text
gadgetnow_item_cost=driver.find_element(By.XPATH,
"/html/body/div[1]/div[2]/div[5]/div[1]/div/div[1]/div[2]/div[1]/span[1]").text
gadgetnow_price = extract_price(gadgetnow_item_cost)
gadgetnow_item_description=driver.find_element(By.XPATH,
"/html/body/div[1]/div[2]/div[5]/div[1]/div/div[3]/div[2]/div[1]/div[3]").text
39
print(gadgetnow_item_description)
driver.get('https://www.sangeethamobiles.com/product-details/iPhone-12-256GB-
Black-Apple/8510?utm_source=google&utm_campaign=Apple-PerformanceMax-
Mobile-
Scaling&gad_source=1&gclid=EAIaIQobChMIpJP38c7mhAMVE6dmAh0WBQL
SEAQYASABEgIbPvD_BwE')
sangeeta_item_name=driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div/div[1]/div/div[2]/div[1]/div/div[2]/h1").text
sangeeta_item_cost=driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div/div[1]/div/div[2]/div[1]/div/div[2]/div[3]/div[1]/
div[1]").text
sangeeta_price = extract_price(sangeeta_item_cost)
40
sangeeta_item_description=driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div/div[1]/div/div[2]/div[12]").text
print(sangeeta_item_description)
time.sleep(3)
driver.get('https://www.flipkart.com/apple-iphone-12-black-256-gb/p/
itm68421fa1c1121?
pid=MOBFWBYZ7CR9FRHZ&lid=LSTMOBFWBYZ7CR9FRHZNVRHN
R&marketplace=FLIPKART&q=iphone12&store=tyy
%2F4io&srno=s_1_1&otracker=search&otracker1=search&fm=organic&iid=
a421f941-aad1-48f3-b6f6-
41
07475d4ce4f8.MOBFWBYZ7CR9FRHZ.SEARCH&ppt=hp&ppn=homepage
&ssid=hqatg1buds0000001709962435415&qH=ad588135f239b88b')
time.sleep(3)
driver.find_element(By.XPATH,
"/html/body/div[1]/div/div[3]/div[1]/div[1]/div[2]/div/ul/li[1]/button").click()
time.sleep(2)
driver.find_element(By.XPATH,
"/html/body/div[1]/div/div[2]/div/div[1]/div[1]/div/div[3]/div/form/
button").click()
time.sleep(2)
driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div/div[1]/div[1]/div/div/div/div/div[1]/div/form/
div[1]/input").send_keys("shlok.abhishek127@gmail.com")
time.sleep(2)
driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div/div[1]/div[1]/div/div/div/div/div[1]/div/form/
div[3]/button").click()
driver.get('https://www.saucedemo.com/inventory.html')
time.sleep(3)
42
driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div[1]/div/div/form/div[1]/input").send_keys('standard_
user')
driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div[1]/div/div/form/div[2]/input").send_keys('secret_sa
uce'
driver.find_element(By.XPATH,
"/html/body/div/div/div[2]/div[1]/div/div/form/input").click()
time.sleep(3)
driver.find_element(By.XPATH,
"/html/body/div/div/div/div[2]/div/div/div/div[1]/div[2]/div[2]/button").click()
time.sleep(3)
driver.find_element(By.XPATH,
"/html/body/div/div/div/div[1]/div[1]/div[3]/a").click()
time.sleep(3)
driver.find_element(By.XPATH,
"//html/body/div/div/div/div[2]/div/div[2]/button[2]").click()
43
driver.find_element(By.XPATH,
"/html/body/div/div/div/div[2]/div/form/div[1]/div[1]/input").send_keys("Abhishe
k")
river.find_element(By.XPATH,
"/html/body/div/div/div/div[2]/div/form/div[1]/div[2]/input").send_keys("Kumar")
driver.find_element(By.XPATH,
"/html/body/div/div/div/div[2]/div/form/div[1]/div[3]/input").send_keys("110044")
time.sleep(3)
driver.find_element(By.XPATH,
"/html/body/div/div/div/div[2]/div/form/div[2]/input").click()
time.sleep(5)
driver.find_element(By.XPATH,
"/html/body/div/div/div/div[2]/div/div[2]/div[9]/button[2]").click()
driver.quit()
44
time.sleep(3)
driver.get('https://shop.gadgetsnow.com/smartphones/apple-iphone-12-256-
gb-black-4- gb-ram-/10021/p_G201794?
gad_source=1&gclid=EAIaIQobChMI7qbuw8zmhAMVe6tmAh3FjgmEEAQ
YAiABEgLWwfD_BwE')
time.sleep(3)
driver.find_element(By.XPATH,
"/html/body/div[1]/div[2]/div[5]/div[1]/div/div[3]/div[2]/div[2]/div[2]/span/
a").click()
time.sleep(3)
driver.find_element(By.XPATH,
"/html/body/div[20]/div[2]/div/div/form/div[3]/div[2]/div[2]/a").click()
time.sleep(3)
driver.quit()
45
time.sleep(3)
driver.get('https://www.sangeethamobiles.com/product-details/apple-iphone-
12-black-256gb-mgjg3hna/8510')
time.sleep(3)
driver.quit()
46
5. Standardisation of Coding.
5.2 Error Handling. The entire code consist of only one function
which converts the string value of price received/scrapped from the E-
Commerce website into integer value for price comparison. There is a try
and catch mechanism implemented in this function to accept only integer
value in the price element and reject the symbols and decimal values to
avoid inconsistency in the fetched data.
The testing done here was System Testing checking whether the user
requirements were satisfied. The code for the new system has been written
completely using python as the coding language, Django/ Selenium as the interface
for front-end designing. The new system has been tested well with the help of
the users and the system has been tested for each element using test websites
available online for selenium project. It saved a lot of time and cost. The
various tests which were carried out for this particular application are:-
1. https://bugbug.io/blog/testing-frameworks/best-
selenium-practice-websites/
2. https://techbeamers.com/websites-to-practice-
selenium-webdriver-online/
49
50
testing for construction the program structure while at the same time
objective is to take unit tested modules and build a program structure. All
the modules are combined and tested as a whole. Here correction is difficult
because the isolation of cause is complicate by the vast expense of the entire
program. Thus in the integration testing stop, all the errors uncovered are
corrected for the text testing steps. In this project case the integration
1. https://www.saucedemo.com/v1/inventory.html
2. https://www.inmotionhosting.com/
which works totally on automation. Due to this reason, it does not follow
projects.
51
1. https://www.sangeethamobiles.com/
2. https://www.gadgetsnow.com/
3. https://www.flipkart.com
6.5 Output Testing. After performing validation testing, the next step is
output testing of the system since no system could be useful if it does not
produce the required output in the specified format. Asking the users about
the format required by them tests the outputs generated by the system under
consideration. Here the output format is considered in two ways, one is on
the screen and other is the printed format. The output format on the screen is
found to be correct as the format was designed in the system designed phase
52
according to the user needs. For the hard copy also the output comes as the
specified requirements by the users. Hence output testing does not result any
corrections in the system.
6.7 Test Cases. Different sites with different currency and decimal
format were tested for validity of price conversion module of the system. In
this program, the entire concept is pertaining to scrapping of data. The get
module of selenium was found working on all test sites as well as real E-
Commerce site.
Description: The user will be asked User_Id and Password to launch the
application. The software will validate the inputs and launch the application only if
the given inputs match with the corresponding values in the database.
54
Description: The software will extract the details of the product selected by
the user on Flipkart. The details will consist of item name, cost and
description of the product.
56
Description: The software will extract the details of the product selected by the
user on GADGET NOW. The details will consist of item name, cost and
description of the product.
58
Description: The software will extract the details of the product selected by the
user on SANGEETHAMOBILES. The details will consist of item name, cost and
description of the product.
60
Description: This module will find the lowest price available among the sites and
recommend the site for purchase. In this case it has recommended ‘Flipkart” to the
user.
61
Description: This module will add the item into the cart of the site having lowest
price.
63
Description: This module will place the order on behalf of the user. From here, he
will operate on dummy site Swag Labs which will ask for buyer username and
password for the respective site and finalize the order. A dummy site has been
selected to prevent actual placing of the order as the project run on real time sites.
64
ORDER PLACED
68
Marketing:
In the near future, Web scraping will be one of the important tools in the lead
generation process. The web scraping tool can make market research of the
particular product/services and enormous benefits to offer in the marketing field.
Web Scraping can help in getting insight of how customers/clients can think about
the product or services and helps to design a marketing strategy for the
product/services. The Web Scraping of user reviews and customer feedback will be
very important in the near future.
Web Scraping is an important tool in determining the price tag of the product in an
eCommerce store. Most of the businesses are deriving the strategies for the data
that they have scraped for the digital monitoring of the competitor’s website. This
trend will be manifold in the coming years. So the need for web scraping services
will increase in the field of E-commerce stores, Hotel and Travel Industry.
Market trends and forecast plays an important role in the Equity-based Markets.
Investors also want to know about the latest and upcoming forecasts of the market
and web scraping can play an important role in tracking the marketing trends. This
information about the market can help investors to invest more sensibly.
69
At present the code is using dummy site for placing the order. Same can be
done using actual E-Commerce site. However, every E-commerce site has
implemented security mechanism to prevent scrapping and use of automated
code to access the site. However, this issue can be resolved by hanging the
IP address whenever the user wants to access the site. There are various paid
platform from where you can subscribe and get fake IP address to do the
scrapping.
Recommendations.
There is always room for improvement, and the software we created can also
be improved. This is especially because we had to create it within a limited
time. With more time, the software can be improved to include security and
different types of users. We can use proxy sites to get proxy IP address.
Additionally, we can put a time loop to prevent internet speed delays to
cause no availability of input for the next module.
Conclusion.
This was our project of System Design about “Products Price Comparison
Website Project” developed in Selenium/Django, using python as the
coding programming language. The Development of this system takes a lot
of efforts. We think this system gave a lot of satisfaction. Though every task
is never said to be perfect in this development field even more improvement
may be possible in this application.
70
BIBLIOGRAPHY
APPENDIX
INTRODUCTION
A simple language which is easier to learn Python has a very simple and
elegant syntax. It's much easier to read and write Python programs
compared to other languages like: C++, Java, C#. Python makes
programming fun and allows you to focus on the solution rather than
syntax.If you are a newbie, it's a great choice to start your journey with
Python.
Free and open-source You can freely use and distribute Python, even for
commercial use. Not only can you use and distribute software’s written in
it, you can even make changes to the Python's source codE. Python has a
large community constantly improving it in each iteration.
Portability
72
You can move Python programs from one platform to another, and run it
without any changes. It runs seamlessly on almost all platforms including
Windows, Mac OS X and Linux.
Unlike C/C++, you don't have to worry about daunting tasks like memory
management, garbage collection and so on.
Likewise, when you run Python code, it automatically converts your code to
the language your computer understands. You don't need to worry about
any lower-level operations.
Object-oriented
Web Applications
You can create scalable Web Apps using frameworks and CMS (Content
Management System) that are built on Python. Some of the popular platforms for
creating Web Apps are: Django, Flask, Pyramid, Plone, Django CMS. Sites like
Mozilla, Reddit, Instagram and PBS are written in Python.
There are numerous libraries available in Python for scientific and numeric
computing. There are libraries like: SciPy and NumPy that are used in general
purpose computing. And, there are specific libraries like: EarthPy for earth
science, AstroPy for Astronomy and so on. Also, the language is heavily used in
machine learning, data mining and deep learning.
Python is slow compared to compiled languages like C++ and Java. It might not be
a good choice if resources are limited and efficiency is a must.
However, Python is a great language for creating prototypes. For example: You
can use Pygame (library for creating games) to create your game's prototype first.
If you like the prototype, you can use language like C++ to create the actual game.
Syntax Overview
It's easier to understand and write Python code. Why? The syntax feels natural.
Take this source code for an example:
a=2
b=3
sum = a + b
print(sum)
Python has a large supporting community. There are numerous active forums
online which can be handy if you are stuck. Some of them are:
Django documentation
Features of Django
o Rapid Development
o Secure
o Scalable
75
o Fully loaded
o Versatile
o Open Source
o Vast and Supported Community
Rapid Development
Django was designed with the intention to make a framework which takes less
time to build web application. The project implementation phase is a very time
taken but Django creates it rapidly.
Secure
Django takes security seriously and helps developers to avoid many common
security mistakes, such as SQL injection, cross-site scripting, cross-site request
forgery etc. Its user authentication system provides a secure way to manage user
accounts and passwords.
Scalable
Django is scalable in nature and has ability to quickly and flexibly switch from
small to large scale application project.
Fully loaded
Django includes various helping task modules and libraries which can be used to
handle common Web development tasks. Django takes care of user
authentication, content administration, site maps, RSS feeds etc.
Versatile
Django is versatile in nature which allows it to build applications for different-
different domains. Now a days, Companies are using Django to build various types
of applications like: content management systems, social networks sites or
scientific computing platforms etc.
76
Open Source
Django is an open source web application framework. It is publicly available
without cost. It can be downloaded with source code from the public repository.
Open source reduces the total cost of the application development.
WAMP Server
PHP Admin
Allows you to change or add users and for making new databases
phpMyAdmin is a free software tool written in PHP, intended to handle the
administration of MySQLover the World Wide Web. phpMyAdmin supports a
wide range of operations with MySQL. The most frequently used operations are
supported by the user interface (managing databases, tables, fields, relations,
indexes, users, permissions, etc.), while you still have the ability to directly
execute any SQL statement.
78
Features
PHP Configuration
PHP for Windows must be installed from the zip package, not using the
installer because the installer does not work correctly when setting up the
configuration files. Download the latest Windows binary version from the 5.x
release series.
Create folder C:\Program Files\PHP5 and unzip the downloaded package
there. Then, in folder C:\Program Files\PHP5 you need to copy the file php.ini-
recommended asphp.ini and make two changes into the php.ini file.
Change extension_dir to:
extension=php_mysql.dll
required. After Apache is installed and configured, also PHP configuration can be
tested.