Phone Comparison Website(on hold)
Phone Comparison Website Project Github
Website Goal:
This website lets the users two phones through search engine and compares them for the user. Unlike other websites where they list out features of two phones, our website tells the user what is different by how much and also gives advice to the user.
์ด ์ฌ์ดํธ๋ ์ ์ ๊ฐ ํธ๋ํฐ ๋๊ฐ๋ฅผ ๊ณ ๋ฅด๋ฉด ๊ทธ ํธ๋ํฐ์ ๋น๊ตํ ๋ค ํน์ ์คํ์ด ์ผ๋งํผ ์ฐจ์ด๋๋์ง ๊ฐ๋ฅด์ณ ์ฃผ๋ ์ฌ์ดํธ๋ค. ์ฌํ ์ฌ์ดํธ์๋ ๋ค๋ฅด๊ฒ ๋ ํธ๋ํฐ์ ์ ๋ณด๋ฅผ ๋์ด ํด์ฃผ๋ ๊ฒ์ ๊ธฐ๋ณธ์ด๋ฉฐ ์ฐจ์ด์ ์ ์ฝ๊ฒ ์ค๋ช ํด์ฃผ๋ฉฐ ์กฐ์ธ๊น์ง ํด์ฃผ๋ ์ฌ์ดํธ์ด๋ค.
Design:
Our website collects phone datas form โDanawa,โ and use search engine to let user choose two phones they want to compare. After user chooses two phones, we give advice by comparing two numerical values of phones features and give comparison and analytical advice.
์ด ์ฌ์ดํธ๋ ๋ค๋์๋ฅผ ํตํด ํธ๋ํฐ ์ ๋ณด๋ฅผ ์ป์ผ๋ฉด ๊ฒ์ ์์ง์ ์ด์ฉํ์ฌ ์ ์ ๊ฐ ๋น๊ต๋ฅผ ์ํ๋ ํธ๋ํฐ์ ๊ฒ์ ์ ๋ณด์ฌ์ฃผ๊ณ ๊ณ ๋ฅด๊ฒ ํ๋ค. ์ ์ ๊ฐ ํธ๋ํฐ์ ๊ณ ๋ฅด๊ณ ๋ ํ์ ๋ ํธ๋ํฐ์ ์คํ์ ๋น๊ตํ์ฌ ์ ์ ์๊ฒ ์กฐ์ธ์ ํด์ค๋ค.
Problems:
๋ค๋์ ๊ฐ์ ์ฌ์ดํธ๋ ๋์ ํ์ด์ง๋ผ์ HTML ํ๊ทธ ๊ตฌ์กฐ๋ฅผ ํ์ ํ๊ธฐ ์ด๋ ต๋ค. ๋ฐ๋ผ์, Beautifulsoup, requests ๋ฟ๋ง ์๋๋ผ selenium๋ ์ฌ์ฉํด์ผ ํ์ ์ด ๊ฐ๋ฅํ๋ค.
๐งSelenium์ ์ฌ์ฉํ๋ฉด ๋๋ฆฌ๋ค๋ ๋จ์ ์ด ์๋ค.
๊ฐ๋ฐ์ ๋๊ตฌ์์ ์์๋ ์์ค๊ฐ ๋ค๋ฅด๋ฉด ๋์ ์น์ฌ์ดํธ์ธ์ง ๋ฐ๋ก ํ์ธ ๊ฐ๋ฅ
๋๊ฐ์ ํธ๋ํฐ ๊ฑฐ๋ฅผ ์ ์๋๋ก ๊ตฌํํ๊ธฐ
Data:
Functions:
Main.py: creates the overall website
Scrapper.py: extract information form website
- extract_phone:
- input:
- html: gets the tags of phones
- function: extract the phone information from the html tags
- return: return dictionary of phones different informations
- input:
- extract_phones:
- input:
- last_page: gets total pages, but there are too many phones, so only recent 10 pages
- url: for links of different pages
- function: use extract_phone function to get data from different pages and put them into phones array
- return: phones array
- input:
export.py: turn information into .csv file
Website:
Search Engine:
Need a search engine to access the data
Comparison Page :
Need to load user chosen phone data
Web Framework:
Flask:
- Micro Framework
- Designed for one application
- Does not have ๐งORM(Object Relational Mapping)
- Easier to add new features
Django:
- Full-stack Framework
- Designed for multiple application
- Has ORM
- Complex to add new features
๐ง When communicating with database one has to use the query, this query differs by every database(MySQL, Oracle โฆ etc) and ORM is a function that helps us use python instead of query
Port Forwarding:
Tried port forwarding to access website from other device that is not local. Coding did not need any change, but only need to change the setting of the router. Had to set the internal and external port number range for the router.
Leave a comment