This is a python script that gives price of the product in the url entered by user. The URL must belong to any product in the http://www.hepsiburada.com/ which is a Turkish online shopping website.
For Windows :
- Create a txt file and copy all the code, paste it in the txt file and save it as a find_price.py file under C:\ directory.
- To run the python code you need python so go to website : https://www.python.org/downloads/ download and install python.
- After installation, open a command prompt (cmd) and enter like this:
C:>Python34\python.exe C:\find_price.py
For Linux :
- First, you need to check if python is installed. To learn it type :
python --version - If it is installed then you will see a verion of python. Otherwise, you need to install it. For installation type :
apt-get install python - You also need to install 'beautifulsoup4' library.
pip install beautifulsoup4 - After installation, you need to create a file 'find_price.py' via vim and copy the code, paste it then save this file.
Then run the following code :
python2.7 find_price.py
For Python2.x.x versions :
- You need to change the 'input' to 'raw_input' otherwise you will get error.
- Goto line 7
- Change the 'input' with 'raw_input'. So it will look like:
URL = raw_input('Enter an URL : ')