Index: phonelux_scrappers/scrappers/a1_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/a1_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/a1_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,113 @@
+import unicodedata
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "A1"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+a1_url = 'https://www.a1.mk/webshop/mk/phones'
+
+response1 = requests.get(a1_url)
+soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+phones = soup1.find('main', {'class', 'gsm-advisor-grid phones'}).find('div', {'class', 'd-flex'}) \
+    .find_all('div', {'class', 'dvc-idtfr by4'})
+
+for phone in phones:
+    brand = phone.get('data-brand').strip()
+    offer_name = brand+" "+phone.get('data-model').strip()
+
+    # if brand not in offer_name:
+    #     offer_name = brand+" "+offer_name
+
+    offer_shop_code = phone.get('data-productid').strip()
+    offer_url = phone.find('a', {'class', 'device-link'}).get('href')
+    image_url = phone.get('data-image')
+
+    response2 = requests.get(offer_url)
+    soup2 = BeautifulSoup(response2.content, 'html.parser')
+
+    temp_prices = soup2.find('div', {'class': 'ured-tabs-content'}) \
+        .find('div', {'class': 'cenovnik-secondary d-flex justify-content-between'}).find_all('div')
+
+    # offer price
+    price = None
+    for temp_price in temp_prices:
+        if 'Цена само за уред' in temp_price.get_text().strip():
+            price = int(temp_price.get_text().replace('Цена само за уред', '')
+                        .replace('Одбери', '').replace('денари', '').replace('.', '').strip())
+
+    colors_section = soup2.find('div', {'id': 'hero'}).find('div', {'class': 'widget'}).find_all('label')
+
+    temp_colors = []
+    for color_section in colors_section:
+        temp_colors.append(color_section.get('data-content'))
+
+    color = ','.join(temp_colors)  # colors available for the offer
+
+    phone_description = soup2.find('div', {'class': 'desc section'}).find('p').get_text().strip()
+
+    table_rows = soup2.find('table', {'class': 'table karakteristiki'}).find_all('tr')
+
+    back_camera = None
+    operating_system = None
+    cpu = None
+    rom_memory = None
+    ram_memory = None
+    battery = None
+    front_camera = None
+
+    for row in table_rows:
+        if 'Камера' in row.get_text().strip():
+            back_camera = row.get_text().replace('Камера', '').strip()
+
+        if 'Оперативен систем' in row.get_text().strip():
+            operating_system = row.get_text().replace('Оперативен систем', '').strip()
+
+        if 'CPU' in row.get_text().strip():
+            cpu = row.get_text().replace('CPU', '').strip()
+
+        if 'Вградена меморија' in row.get_text().strip():
+            rom_memory = row.get_text().replace('Вградена меморија', '').strip()
+
+        if 'RAM меморија' in row.get_text().strip():
+            ram_memory = row.get_text().replace('RAM меморија', '').strip()
+
+        if 'Батерија' in row.get_text().strip():
+            battery = row.get_text().replace('Батерија', '').strip()
+
+        if 'Предна камера' in row.get_text().strip():
+            front_camera = row.get_text().replace('Предна камера', '').strip()
+
+    insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name, price, image_url, offer_url,' \
+                    'ram_memory, rom_memory, battery, back_camera, front_camera, color, cpu, ' \
+                    'operating_system, offer_shop_code, last_updated, is_validated)' \
+                    ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+    insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory, rom_memory,
+                    battery, back_camera, front_camera, color, cpu, operating_system, offer_shop_code,
+                    last_updated, is_validated)
+    cur.execute(insert_script, insert_value)
+    db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/akcija_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/akcija_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/akcija_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,74 @@
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+import requests
+import unicodedata
+import sys
+
+# file_path = '../outputfile.txt'
+# sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Akcija"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+i = 0
+while i <= 20:
+    akcija_url = "https://akcija.com.mk/listing/" + str(i) + "?category=mobilnitelefoni"
+    response1 = requests.get(akcija_url)
+    response1.encoding = 'utf-8'
+    soup1 = BeautifulSoup(response1.text, 'html.parser')
+
+    phones = soup1.find_all('div', {'class', 'product-item__body pb-xl-2'})
+
+    for phone in phones:
+        offer_name = phone.find('h5', {'class': 'mb-1 product-item__title'}).find('a') \
+            .get_text().replace('Паметен телефон', '').strip()
+        brand = offer_name.split(' ')[0]
+
+        if brand not in offer_name:
+            offer_name = brand + " " + offer_name
+
+        offer_url = phone.find('h5', {'class': 'mb-1 product-item__title'}).find('a').get('href')
+        image_url = phone.find('div', {'class', 'mb-2'}).find('img').get('src')
+        price = int(phone.find('div', {'class', 'flex-center-between mb-1 pt-xl-2'}) \
+                    .find('ins').get_text().split(' ')[0].strip())
+
+        response2 = requests.get(offer_url)
+        response2.encoding = 'utf-8'
+        soup2 = BeautifulSoup(response2.text, 'html.parser')
+
+        specifications = soup2.find('main', {'id': 'content'}) \
+            .find_all('div', {'class', 'container'})[1].find('div', {'class', 'mb-14'}) \
+            .find('div', {'class', 'col-md-6 col-lg-4 col-xl-4 mb-md-6 mb-lg-0'}).find_all('p')
+
+        offer_description = ''
+        for specification in specifications:
+            if 'Код за нарачка' in str(specification.get_text(separator='\n').replace('NBSP', '').strip()):
+                continue
+            offer_description += unicodedata.normalize('NFKD',
+                                                       str(specification.get_text(separator='\n').strip())) + "\n"
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand,' \
+                        ' offer_name, price, image_url, offer_url, last_updated, is_validated, offer_description) ' \
+                        'VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url,
+                        last_updated, is_validated, offer_description)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+    i += 20
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/anhoch_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/anhoch_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/anhoch_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,90 @@
+import time
+from datetime import datetime
+import psycopg2
+from selenium import webdriver
+from selenium.webdriver.common.by import By
+from selenium.webdriver.support.ui import WebDriverWait
+from selenium.webdriver.support import expected_conditions as EC
+
+import config_read
+from bs4 import BeautifulSoup
+import requests
+import unicodedata
+import sys
+
+file_path = '../outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+
+def scrape_function(driver1, i):
+    offer_shop = "Anhoch"  # offer shop
+    last_updated = datetime.now().date()
+    is_validated = False
+
+    anhoch_html = driver1.page_source
+    soup1 = BeautifulSoup(anhoch_html, 'html.parser')
+    active_li = soup1.find('div', {'class': 'adjust-elems pagination pagination-centered'}).find('li', {'class': 'active'})
+
+    li_element = int(active_li.get_text().strip())
+
+    print('page: '+str(li_element))
+
+    if int(active_li.get_text().strip()) == i:
+        phones = soup1.find('section', {'id': 'main'}).find('div', {'class': 'span8'}) \
+            .find('div', {'class': 'products'}).find_all('li')
+        for phone in phones:
+            offer_url = phone.find('a').get('href')
+            image_url = phone.find('a').find('img').get('src')
+            offer_name = phone.find('div', {'class': 'product-name'}).find('a').get_text().strip()
+            price = int(phone.get('data-price'))
+            brand = phone.find('div', {'class': 'product-price'}).find_all('div')[2].find('strong').get_text().strip()
+
+            response2 = requests.get(offer_url)
+            soup2 = BeautifulSoup(response2.content, 'html.parser')
+            offer_shop_code = soup2.find('div', {'class': 'product-desc'}).get_text().strip().split('\n')[3]
+
+            offer_description = soup2.find('div', {'class': 'description'}) \
+                .find('div', {'class': 'tab-content'}).find('pre').get_text().strip()
+
+            print(offer_name)
+            print(brand)
+            print()
+            print()
+
+            # insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name , price, image_url, offer_url,' \
+            #                 'offer_shop_code, offer_description, last_updated, is_validated)' \
+            #                 ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+            # insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url,
+            #                 offer_shop_code, offer_description, last_updated, is_validated)
+            # cur.execute(insert_script, insert_value)
+            # db_connection.commit()
+    else:
+        driver1.implicitly_wait(5)
+        scrape_function(driver1, i)
+
+
+for i in range(1, 19):
+    anhoch_url = "https://www.anhoch.com/category/3017/smartfoni-i-mobilni-tel#page/"+str(i)
+    # print(anhoch_url)
+
+    # selenium is used because of the dynamic content of the page
+    driver1 = webdriver.Safari(executable_path='/usr/bin/safaridriver')
+    driver1.get(anhoch_url)
+
+    scrape_function(driver1, i)
+    # closing the driver so the safari instance can pair with another webdriver session
+    driver1.close()
+
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/handy_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/handy_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/handy_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,78 @@
+import unicodedata
+from datetime import datetime
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+from selenium import webdriver
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Handy"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+handy_url = 'https://www.handy.mk/telefoni?page=6'
+
+response1 = requests.get(handy_url)
+soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+phones = soup1.find_all('li', {'data-hook': 'product-list-grid-item'})
+
+for phone in phones:
+    offer_url = phone.find('a').get('href')
+    offer_name = phone.find('div', {'data-hook': 'not-image-container'})\
+        .find('h3', {'data-hook': 'product-item-name'}).get_text().strip()
+    brand = offer_name.split(' ')[0].capitalize()
+    price = int(float(phone.find('div', {'data-hook': 'not-image-container'}).find('div', {'data-hook': "product-item-product-details"})\
+        .find('span', {'data-hook': 'product-item-price-to-pay'}).get_text().strip().replace('ден', '').replace('.', '').replace(',', '.')))
+
+    response2 = requests.get(offer_url)
+    soup2 = BeautifulSoup(response2.text, 'html.parser')
+
+    color_section = soup2.find('section', {'data-hook': 'product-colors-title-section'})
+
+    color = None
+    if color_section is not None:
+        temp_colors = color_section.find('fieldset', {'class': 'ColorPickerbase3563640754__container'})\
+            .find_all('input', {'type': 'radio'})
+        colors_list = []
+        for temp_color in temp_colors:
+            colors_list.append(temp_color.get('aria-label'))
+        color = ','.join(colors_list)
+
+    rows = soup2.find('div', {'data-hook': 'info-section-description'}).find_all('li')
+
+    if len(rows) == 0:
+        rows = soup2.find('div', {'data-hook': 'info-section-description'}).find_all('tr')
+
+    specifications = []
+
+    for row in rows:
+        specifications.append(unicodedata.normalize('NFKD', row.get_text().strip()))
+
+    offer_description = '\n'.join(specifications)
+
+    insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name , price, offer_url, ' \
+                    'offer_description, last_updated, is_validated)' \
+                            ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s);'
+    insert_value = (offer_shop, brand, offer_name, price, offer_url, offer_description,
+                            last_updated, is_validated)
+    cur.execute(insert_script, insert_value)
+    db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/ledikom_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/ledikom_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/ledikom_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,125 @@
+import unicodedata
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+from selenium import webdriver
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Ledikom"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+ledikom_phone_urls = [
+    'https://ledikom.mk/c/416/uredi/apple/iphone?limit=96',
+    'https://ledikom.mk/c/421/uredi/samsung/telefoni?limit=96',
+    'https://ledikom.mk/c/424/mobilni-telefoni/xiaomi/telefoni?limit=96',
+    'https://ledikom.mk/c/430/uredi/huawei/telefoni?limit=96',
+    'https://ledikom.mk/c/441/uredi/oneplus/telefoni?limit=96',
+    'https://ledikom.mk/c/413/uredi/google/telefoni?limit=96',
+    'https://ledikom.mk/c/411/uredi/honor/telefoni?limit=96',
+    'https://ledikom.mk/c/460/uredi/nokia/telefoni?limit=96',
+    'https://ledikom.mk/c/461/uredi/asus/telefoni?limit=96',
+    'https://ledikom.mk/c/488/proizvodi/oppo/telefoni?limit=96'
+]
+
+for ledikom_url in ledikom_phone_urls:
+
+    # selenium is used because of the dynamic content of the page
+    driver1 = webdriver.Safari(executable_path='/usr/bin/safaridriver')
+    driver1.get(ledikom_url)
+    ledikom_html = driver1.page_source
+
+    # closing the driver so the safari instance can pair with another webdriver session
+    driver1.close()
+
+    soup1 = BeautifulSoup(ledikom_html, 'html.parser')
+
+    phones = soup1.find('div', {'id': 'content'}) \
+        .find('div', {'class': 'container'}).find('div', {'class': 'row'}).find('div', {'class': 'item-display'}) \
+        .find_all('div', {'class': 'item-in-grid'})
+
+    if len(phones) == 0:
+        continue
+
+    for phone in phones:
+        offer_url = 'https://ledikom.mk' + phone.find('a').get('href')
+        image_url = phone.find('a').find('img').get('src')
+        temp_offer_name = phone.find('div', {'class': 'item-name'}).find('a').get_text().strip()
+        offer_name = ' '.join(temp_offer_name.split())
+        brand = offer_name.split(' ')[0]
+        price = int(phone.find('span', {'class': 'price'}).get_text().replace('ден.', '').replace('.', '').strip())
+
+        driver1 = webdriver.Safari(executable_path='/usr/bin/safaridriver')
+        driver1.get(offer_url)
+        # getting offer page html
+        offer_html = driver1.page_source
+        driver1.close()
+
+        soup2 = BeautifulSoup(offer_html, 'html.parser')
+
+        specifications = soup2.find('div', {'id': 'content'}).find('section', {'class': 'padding-section'}) \
+            .find_all('div', {'class': 'container'})[1].find('div', {'class': 'col-md-7'}) \
+            .find_all('div', {'class': 'row'})
+
+        color = None
+        rom_memory = None
+        ram_memory = None
+
+        if len(specifications) != 0:
+            colors_tags = specifications[0].find('div', {'class': 'col-md-12 col-xs-12'}).find_all('a')
+            temp_colors = []
+            for color_tag in colors_tags:
+                temp_colors.append(color_tag.get_text().strip())
+            color = ','.join(temp_colors)
+
+        if len(specifications) >= 2:
+            temp_rom = specifications[1].find('div', {'class': 'col-md-12 col-xs-12'}).find_all('a')
+            rom_list = []
+            for rom in temp_rom:
+                rom_list.append(rom.get('title'))
+            rom_memory = ','.join(rom_list)
+
+        if len(specifications) >= 3:
+            temp_ram = specifications[2].find('div', {'class': 'col-md-12 col-xs-12'}).find_all('a')
+            ram_list = []
+            for ram in temp_ram:
+                ram_list.append(ram.get('title'))
+
+            ram_memory = ','.join(ram_list)
+
+        if 'Xiaomi' in brand:
+            temp = color
+            color = rom_memory
+            rom_memory = temp
+
+            temp = ram_memory
+            ram_memory = color
+            color = temp
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name, price, image_url, offer_url,' \
+                        'ram_memory, rom_memory, color, last_updated, is_validated)' \
+                        ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory,
+                        rom_memory, color, last_updated, is_validated)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/mobelix_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/mobelix_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/mobelix_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,133 @@
+import unicodedata
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+import requests
+
+# import sys
+#
+# file_path = 'outputfile.txt'
+# sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Mobelix"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+for i in range(1, 17):
+    mobelix_url = "https://mobelix.com.mk/mk/mobilni-telefoni?page=" + str(i)
+
+    response1 = requests.get(mobelix_url)
+    soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+    phones = soup1.find_all('div', {'class': 'p-2 rounded text-dark bg-white d-flex w-100'})
+
+    for phone in phones:
+        offer_url = phone.find('a').get('href')
+        image_url = phone.find_all('div', {'class': 'col-12'})[0].find('img').get('src')
+        brand = phone.find_all('div', {'class': 'col-12'})[1].find('h5', {'class': 'mb-0'}).get_text().strip()
+        offer_name = phone.find_all('div', {'class': 'col-12'})[1] \
+            .find('h3', {'class': 'h5 font-weight-normal'}).get_text().strip()
+
+        if 'Watch' in offer_name or 'Pad' in offer_name or 'Tab' in offer_name or 'Pods' in offer_name or 'Buds' in offer_name or 'HomePod' in offer_name:
+            continue
+
+        if brand not in offer_name:
+            offer_name = brand + " " + offer_name
+
+        temp_prices = phone.find_all('div', {'class': 'col-12'})[1] \
+            .find('p', {'class': 'h5 price'}).get_text(separator='/').strip()
+
+        if len(temp_prices.split('/')) > 1:
+            price = int(float(temp_prices.split('/')[1].replace(',', '').replace('ден', '').strip()))
+        else:
+            price = int(float(temp_prices.split('/')[0].replace(',', '').replace('ден', '').strip()))
+
+        response2 = requests.get(offer_url)
+        soup2 = BeautifulSoup(response2.content, 'html.parser')
+
+        colors_divs = soup2.find('div', {'class': 'color-wrapper mt-2 mb-1'}) \
+            .find_all('div', {'class': 'color-box d-inline-block'})  # color div tags
+
+        temp_colors = []
+        for div in colors_divs:
+            temp_colors.append(div.get('title'))
+
+        color = ",".join(temp_colors)  # available colors for offer
+
+        tables = soup2.find('div', {'class': 'mobelix-specs table-white bordered-table'}).find_all('table')
+
+        operating_system = None
+        chipset = None
+        battery = None
+        ram_memory = None
+        rom_memory = None
+        front_camera = ''
+        back_camera = ''
+        cpu = None
+
+        for table in tables:
+            for cell in table.find_all('td'):
+                if cell.get('data-spec') is None:
+                    continue
+
+                if cell.get('data-spec') == 'os':
+                    operating_system = unicodedata.normalize('NFKD', cell.get_text().strip())
+
+                if cell.get('data-spec') == 'chipset':
+                    chipset = unicodedata.normalize('NFKD', cell.get_text().strip())
+
+                if cell.get('data-spec') == 'cpu':
+                    cpu = unicodedata.normalize('NFKD', cell.get_text().strip())
+
+                if cell.get('data-spec') == 'internalmemory':
+                    temp_rom = []
+                    temp_ram = []
+                    temp_internalmemory = unicodedata.normalize('NFKD', cell.get_text().strip())
+                    for internalmemory in temp_internalmemory.split(','):
+                        temp_rom.append(internalmemory.strip().split(' ')[0])
+                        if len(internalmemory.strip().split(' ')) > 1:
+                            temp_ram.append(internalmemory.strip().split(' ')[1])
+                    rom_memory = ','.join(temp_rom)
+                    ram_memory = ','.join(temp_ram)
+
+                if cell.get('data-spec') == 'cam1modules' or cell.get('data-spec') == 'cam1features' or cell.get(
+                        'data-spec') == 'cam1video':
+                    back_camera += unicodedata.normalize('NFKD', cell.get_text().strip()) + '\n'
+
+                if cell.get('data-spec') == 'cam2modules' or cell.get('data-spec') == 'cam2features' or cell.get(
+                        'data-spec') == 'cam2video':
+                    front_camera += unicodedata.normalize('NFKD', cell.get_text().strip()) + '\n'
+
+                if cell.get('data-spec') == 'batdescription1':
+                    battery = unicodedata.normalize('NFKD', cell.get_text().strip())
+
+        if front_camera == 'No':
+            front_camera = None
+
+        if back_camera == 'No':
+            back_camera = None
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name, price, image_url, offer_url,' \
+                        'ram_memory, rom_memory, battery, back_camera, front_camera, color, cpu, chipset, ' \
+                        'operating_system, last_updated, is_validated)' \
+                        ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory, rom_memory,
+                        battery, back_camera, front_camera, color, cpu, chipset, operating_system,
+                        last_updated, is_validated)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/mobigo_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/mobigo_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/mobigo_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,122 @@
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+import requests
+
+# import sys
+#
+# file_path = 'outputfile.txt'
+# sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Mobi Go"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+for i in range(1, 6):
+    mobigo_url = "https://mobigo.mk/page/" + str(i) + "/"
+
+    response1 = requests.get(mobigo_url)
+
+    soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+    phone_sections = soup1.find_all('ul', {'class': 'recent-posts'})
+    phones = phone_sections[len(phone_sections) - 1].find_all('li')
+
+    for phone in phones:
+        offer_url = phone.find('div', {'class', 'post-thumb'}).find('a').get('href')  # offer url
+        image_url = phone.find('div', {'class', 'post-thumb'}).find('a').find('img').get('src')  # image url
+        offer_name = phone.find('div', {'class', 'post-content'}).find_all('h2')[0].get_text().strip()  # offer_name
+
+        if "Watch" in offer_name or "Tab" in offer_name:  # if the product is watch or tablet, continue
+            continue
+
+        price = int(float(phone.find('div', {'class', 'post-content'}).find_all('h2')[1] \
+                          .get_text().replace('ден.', '').replace('.', '').strip()))  # price
+
+        response2 = requests.get(offer_url)
+        soup2 = BeautifulSoup(response2.content, 'html.parser')
+
+        brand = soup2.find('a', {'rel': 'category tag'}).get_text().strip()  # brand
+
+        if brand not in offer_name:
+            offer_name = brand + " " + offer_name
+
+        specifications = soup2.find('table', {'id': 'singlet'}).find_all('tr')
+
+        ram_memory = ""
+        rom_memory = ""
+        battery = ""
+        back_camera = ""
+        front_camera = ""
+        chipset = ""
+        operating_system = ""
+
+        for specification in specifications:
+            if specification.find('td') == None:
+                continue
+
+            # operating system
+            if specification.find('td').get_text() == "Платформа":
+                if specification.find('i').get_text() != "/":
+                    operating_system = specification.find('i').get_text().strip()
+                else:
+                    operating_system = None
+
+            # chipset
+            if specification.find('td').get_text() == "Chipset":
+                if specification.find('i').get_text() != "/":
+                    chipset = specification.find('i').get_text().strip()
+                else:
+                    chipset = None
+
+            # ram and rom memory
+            if specification.find('td').get_text() == "Меморија":
+                if specification.find('i').get_text() != "/":
+                    rom_memory = specification.find('i').get_text().replace(',', '').split(' ')[0].strip()
+                    ram_memory = specification.find('i').get_text().replace(',', '').split(' ')[1].strip()
+                else:
+                    rom_memory = None
+                    ram_memory = None
+
+            # back camera
+            if specification.find('td').get_text() == "Главна Камера":
+                if specification.find('i').get_text() != "/":
+                    back_camera = specification.find('i').get_text().strip()
+                else:
+                    back_camera = None
+
+            # front camera
+            if specification.find('td').get_text() == "Селфи Камера":
+                if specification.find('i').get_text() != "/":
+                    front_camera = specification.find('i').get_text().strip()
+                else:
+                    front_camera = None
+
+            # battery
+            if specification.find('td').get_text() == "Батерија":
+                if specification.find('i').get_text() != "/":
+                    battery = specification.find('i').get_text().strip()
+                else:
+                    battery = None
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory,' \
+                        ' rom_memory, battery, back_camera, front_camera, chipset, operating_system, last_updated, is_validated)' \
+                        ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory,
+                        rom_memory, battery, back_camera, front_camera, chipset, operating_system, last_updated, is_validated)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/mobilezone_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/mobilezone_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/mobilezone_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,97 @@
+import unicodedata
+from datetime import datetime
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+from selenium import webdriver
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Mobile Zone"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+for i in range(1, 3):
+    mobilezone_url = 'https://mobilezone.mk/produkt-kategorija/telefoni/novi-telefoni/page/' + str(i) + '/'
+
+    response1 = requests.get(mobilezone_url)
+    soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+    phones = soup1.find('ul', {
+        'class': 'products columns-tablet-2 columns-mobile-2 --skin-proto rey-wcGap-default rey-wcGrid-default '
+                 '--paginated columns-4'}).find_all('li')
+
+    for phone in phones:
+        offer_url = phone.find('a', {'class': 'woocommerce-LoopProduct-link woocommerce-loop-product__link'}).get(
+            'href')
+        image_url = phone.find('a', {'class': 'woocommerce-LoopProduct-link woocommerce-loop-product__link'}) \
+            .find('img').get('data-lazy-src')
+
+        brand_section = phone.find('div', {'class': 'rey-productInner'}).find('div', {'class': 'rey-brandLink'})
+
+        if brand_section is not None:
+            brand = brand_section.find('a').get_text().strip()
+        else:
+            brand = None
+
+        offer_name = phone.find('h2', {'class': 'woocommerce-loop-product__title'}).find('a').get_text().strip()
+
+        if brand is not None and brand not in offer_name:
+            offer_name = brand + ' ' + offer_name
+
+        price = int(unicodedata.normalize('NFKD', phone.find('span', {'class': 'woocommerce-Price-amount amount'})
+                                          .find('bdi').get_text().replace(',', '').replace('ден', '').strip()))
+
+        response2 = requests.get(offer_url)
+        soup2 = BeautifulSoup(response2.text, 'html.parser')
+
+        specifications = soup2.find('table', {'class': 'woocommerce-product-attributes shop_attributes'}).find_all('tr')
+
+        back_camera = None
+        front_camera = None
+        rom_memory = None
+        battery = None
+        color = None
+
+        for specification in specifications:
+            if 'Главна камера' in specification.find('th').get_text():
+                back_camera = specification.find('td').get_text().strip()
+
+            if 'Селфи камера' in specification.find('th').get_text():
+                front_camera = specification.find('td').get_text().strip()
+
+            if 'Батерија' in specification.find('th').get_text():
+                battery = specification.find('td').get_text().strip()
+
+            if 'Меморија' in specification.find('th').get_text():
+                rom_memory = specification.find('td').get_text().strip()
+
+            if 'Боја' in specification.find('th').get_text():
+                color = specification.find('td').get_text().strip()
+
+
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name , price, offer_url, image_url, ' \
+                        'rom_memory, battery, color, front_camera, back_camera, last_updated, is_validated)' \
+                                ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, offer_url, image_url, rom_memory, battery, color,
+                        front_camera, back_camera, last_updated, is_validated)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/mobitech_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/mobitech_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/mobitech_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,95 @@
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+import requests
+
+# import sys
+# file_path = 'outputfile.txt'
+# sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+mobitech_url = "https://mobitech.mk/shop/"
+
+response1 = requests.get(mobitech_url)
+
+soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+phones = soup1.find_all('div', {'class': 'jet-woo-products__inner-box'})
+
+offer_shop = "Mobitech"  # offer shop
+is_validated = False
+
+for phone in phones:
+    offer_url = phone.find('h5', {'class': 'jet-woo-product-title'}).find('a').get('href')  # url
+    image_url = phone.find('div', {'class': 'jet-woo-product-thumbnail'}).find('img').get('src')  # image
+    brand = phone.find_next('div', {'class': 'jet-woo-product-categories'}).find('a').get_text().strip()  # brand
+    offer_name = phone.find('h5', {'class': 'jet-woo-product-title'}).find('a').get_text().strip()  # offer_name
+    if brand not in offer_name:
+        offer_name = brand+" "+offer_name
+    temp_prices = phone.find('div', {'class': 'jet-woo-product-price'}).find_all('bdi')
+    price = int(float(temp_prices[len(temp_prices) - 1].get_text().replace("ден", "").replace(",", "").strip())) # price
+    last_updated = datetime.now().date()  # offer last_updated date
+
+    response2 = requests.get(offer_url)
+    soup2 = BeautifulSoup(response2.content, 'html.parser')
+
+    specifications = soup2.find_all('h2', {'class': 'elementor-heading-title elementor-size-default'})
+
+    ram_memory = ""
+    rom_memory = ""
+    battery = ""
+    back_camera = ""
+    operating_system = ""
+
+    for specification in specifications:
+        # rom memory
+        if specification.get_text().startswith("Меморија:"):
+            rom_memory = specification.get_text().split("Меморија:")[1].strip()
+            if rom_memory == "Нема" or rom_memory == "/":
+                rom_memory = None
+
+        # ram memory
+        if specification.get_text().startswith("РАМ Меморија:"):
+            ram_memory = specification.get_text().split("РАМ Меморија:")[1].strip()
+            if ram_memory == "Нема" or ram_memory == "/":
+                ram_memory = None
+
+        # camera
+        if specification.get_text().startswith("Камера:"):
+            back_camera = specification.get_text().split("Камера:")[1].strip()
+            if back_camera == "Нема":
+                back_camera = None
+
+        # operating system
+        if specification.get_text().startswith("Оперативен систем:"):
+            operating_system = specification.get_text().split("Оперативен систем:")[1].split(",")[0].strip()
+            if operating_system == "Нема":
+                operating_system = None
+
+        # battery
+        if specification.get_text().startswith("Батерија:"):
+            battery = specification.get_text().split("Батерија:")[1].strip()
+            if battery == "Нема":
+                battery = None
+
+    insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory,' \
+                    ' rom_memory, battery, back_camera, last_updated, operating_system, is_validated)' \
+                    ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+    insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url, ram_memory,
+                    rom_memory, battery, back_camera, last_updated, operating_system, is_validated)
+    cur.execute(insert_script, insert_value)
+    db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/neptun_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/neptun_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/neptun_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,118 @@
+import unicodedata
+from datetime import datetime
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+from selenium import webdriver
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Neptun"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+for i in range(1, 11):
+    neptun_url = 'https://www.neptun.mk/mobilni_telefoni.nspx?page='+str(i)
+
+    # selenium is used because of the dynamic content of the page
+    driver1 = webdriver.Safari(executable_path='/usr/bin/safaridriver')
+    driver1.get(neptun_url)
+    neptun_html = driver1.page_source
+
+    # closing the driver so the safari instance can pair with another webdriver session
+    driver1.close()
+
+    # response1 = requests.get(neptun_url)
+    soup1 = BeautifulSoup(neptun_html, 'html.parser')
+
+    phones = soup1.find('div', {'id': 'mainContainer'}).find('div',
+                                                             {'class': 'col-lg-9 col-md-9 col-sm-8 col-fix-main'}) \
+        .find_all('div', {'class': 'ng-scope product-list-item-grid'})
+
+    for phone in phones:
+        offer_url = 'https://www.neptun.mk' + phone.find('a').get('href')
+        offer_name = phone.find('a').find('h2').get_text().replace('MOB.TEL.', '').strip()
+        brand = offer_name.split(' ')[0].strip().capitalize()
+        image_url = 'https://www.neptun.mk' + phone.find('a').find('div', {'class': 'row'}).find('img').get('src')
+        price = int(
+            phone.find('div', {'class': 'col-sm-12 static'}).find('div', {'class': 'product-list-item__prices pt35'})
+            .find('div', {'class': 'row'}).find('div', {'class': 'newPriceModel'}) \
+            .find('span', {'class': 'product-price__amount--value ng-binding'}).get_text().replace('.', ''))
+
+        driver1 = webdriver.Safari(executable_path='/usr/bin/safaridriver')
+        driver1.get(offer_url)
+        offer_html = driver1.page_source
+        # closing the driver so the safari instance can pair with another webdriver session
+        driver1.close()
+
+        soup2 = BeautifulSoup(offer_html, 'html.parser')
+
+        offer_shop_code = soup2.find('div', {'ng-if': 'showProductDetails'}) \
+            .find('div', {'class': 'product-details-first-row'}).find('span', {
+            'ng-bind': 'model.CodeNumber'}).get_text().strip()
+
+        specifications_table = \
+            soup2.find('div', {'id': 'mainContainer'}).find('div', {'ng-if': 'showProductDetails'}).find_all('ul')[-1]
+        specifications = specifications_table.get_text(separator='\n').strip().split("\n")
+
+        offer_description = specifications_table.get_text(separator='\n').strip()
+
+        operating_system = None
+        chipset = None
+        battery = None
+        ram_memory = None
+        rom_memory = None
+        cpu = None
+        for specification in specifications:
+            if 'Батерија:' in specification:
+                battery = specification.split('Батерија:')[1]
+
+            if 'CPU:' in specification:
+                cpu = specification.split('CPU:')[1]
+
+            if 'Chipset:' in specification:
+                chipset = specification.split('Chipset:')[1]
+
+            if 'RAM Меморија:' in specification:
+                ram_memory = specification.split('RAM Меморија:')[1]
+                continue
+
+            if 'ROM Меморија:' in specification:
+                rom_memory = specification.split('ROM Меморија:')[1]
+                continue
+
+            if 'ROM:' in specification:
+                rom_memory = specification.split('ROM:')[1]
+
+            if 'RAM:' in specification:
+                ram_memory = specification.split('RAM:')[1]
+
+            if 'iOS' in specification or 'Android' in specification:
+                operating_system = specification
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name , price, image_url, offer_url,' \
+                        'offer_shop_code, operating_system, battery, chipset, cpu, ram_memory, rom_memory, ' \
+                        'offer_description, last_updated, is_validated)' \
+                        ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url,
+                        offer_shop_code, operating_system, battery, chipset, cpu, ram_memory, rom_memory, offer_description,
+                        last_updated, is_validated)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/setec_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/setec_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/setec_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,69 @@
+import unicodedata
+from datetime import datetime
+
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+offer_shop = "Setec"  # offer shop
+last_updated = datetime.now().date()
+is_validated = False
+
+for i in range(1, 7):
+    setec_url = 'https://setec.mk/index.php?route=product/category&path=10066_10067&page='+str(i)
+
+    response1 = requests.get(setec_url)
+    soup1 = BeautifulSoup(response1.content, 'html.parser')
+
+    phones = soup1.find('div', {'id': 'mfilter-content-container'}) \
+        .find_all('div', {'class': 'col-sm-4 col-xs-6'})
+
+    for phone in phones:
+        offer_url = phone.find('div', {'class': 'left'}).find('a').get('href')
+        image_url = phone.find('div', {'class': 'left'}).find('a').find('img').get('src')
+        offer_name = phone.find('div', {'class': 'right'}).find('div', {'class': 'name'}).find('a').get_text().strip()
+        brand = offer_name.split(' ')[0]
+
+        if 'Cable' in offer_name or 'AirTag' in offer_name:
+            continue
+
+        if brand not in offer_name:
+            offer_name = brand + " " + offer_name
+
+        offer_shop_code = phone.find('div', {'class': 'right'}) \
+            .find('div', {'class': 'shifra'}).get_text().replace('Шифра:', '').strip()
+        price = int(phone.find('div', {'class': 'right'}).find('div', {'class': 'price'}). \
+                    find('div', {'class': 'category-price-redovna'}).find('span', {'class': 'price-old-new'}) \
+                    .get_text().replace('Ден.', '').replace(',', '').strip())
+
+        response2 = requests.get(offer_url)
+        soup2 = BeautifulSoup(response2.content, 'html.parser')
+
+        offer_description = soup2.find('div', {'id': 'tab-description'}).get_text(separator='\n')
+
+        insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name , price, image_url, offer_url,' \
+                        'offer_shop_code, offer_description, last_updated, is_validated)' \
+                        ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+        insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url,
+                        offer_shop_code, offer_description, last_updated, is_validated)
+        cur.execute(insert_script, insert_value)
+        db_connection.commit()
+
+cur.close()
+db_connection.close()
Index: phonelux_scrappers/scrappers/tehnomarket_scrapper.py
===================================================================
--- phonelux_scrappers/scrappers/tehnomarket_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
+++ phonelux_scrappers/scrappers/tehnomarket_scrapper.py	(revision b68ae8d3cc34d054d169fb34943b9fcd77bff7c2)
@@ -0,0 +1,97 @@
+import unicodedata
+from datetime import datetime
+import psycopg2
+import config_read
+from bs4 import BeautifulSoup
+from selenium import webdriver
+import requests
+
+import sys
+
+file_path = 'outputfile.txt'
+sys.stdout = open(file_path, "w")
+
+# Call to read the configuration file and connect to database
+cinfo = config_read.get_databaseconfig("../postgresdb.config")
+db_connection = psycopg2.connect(
+    database=cinfo[0],
+    host=cinfo[1],
+    user=cinfo[2],
+    password=cinfo[3]
+)
+cur = db_connection.cursor()
+
+
+def scrape_function(driver1, i):
+    offer_shop = "Tehnomarket"  # offer shop
+    last_updated = datetime.now().date()
+    is_validated = False
+
+    tehnomarket_html = driver1.page_source
+    soup1 = BeautifulSoup(tehnomarket_html, 'html.parser')
+    active_li = soup1.find('div', {'class': 'adjust-elems pagination pagination-centered'}).find('li',
+                                                                                                 {'class': 'active'})
+
+    print('page: ' + active_li.get_text())
+
+    if int(active_li.get_text().strip()) == i:
+        phones = soup1.find('ul', {'class': 'products products-display-grid thumbnails'}).find_all('li', {
+            'class': 'span4 product-fix'})
+
+        for phone in phones:
+            offer_url = phone.find('a').get('href')
+            offer_name = phone.find('div', {'class': 'product-name'}).get_text().strip()
+            price = int(phone.find('div', {'class': 'product-price clearfix'}).find('strong') \
+                        .get_text().replace('ден.', '').replace(',', '').strip())
+
+            response2 = requests.get(offer_url)
+            soup2 = BeautifulSoup(response2.content, 'html.parser')
+
+            image = soup2.find('div', {'id': 'product_gallery'}).find('img')
+
+            image_url = None
+            if image is not None:
+                image_url = image.get('src')
+
+            details = soup2.find('div', {'class': 'product-desc'}).get_text().split('\n')
+
+            brand = details[2].strip().capitalize()
+            offer_shop_code = details[4].strip()
+
+            specifications = []
+            for info in soup2.find_all('span', {'class': 'info'}):
+                specifications.append(info.get_text())
+
+            print(brand)
+            print(offer_name)
+            print()
+            print()
+
+            offer_description = '\n'.join(specifications)
+
+            insert_script = 'INSERT INTO phone_offers (offer_shop, brand, offer_name, price, image_url, offer_url,' \
+                            'offer_description, offer_shop_code, last_updated, is_validated)' \
+                            ' VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s);'
+            insert_value = (offer_shop, brand, offer_name, price, image_url, offer_url, offer_description,
+                            offer_shop_code, last_updated, is_validated)
+            cur.execute(insert_script, insert_value)
+            db_connection.commit()
+    else:
+        driver1.implicitly_wait(30)
+        scrape_function(driver1, i)
+
+
+for i in range(1, 6):
+    tehnomarket_url = 'https://tehnomarket.com.mk/category/4109/mobilni-telefoni#page/' + str(i)
+    # print(anhoch_url)
+
+    # selenium is used because of the dynamic content of the page
+    driver1 = webdriver.Safari(executable_path='/usr/bin/safaridriver')
+    driver1.get(tehnomarket_url)
+
+    scrape_function(driver1, i)
+    # closing the driver so the safari instance can pair with another webdriver session
+    driver1.close()
+
+cur.close()
+db_connection.close()
