Esempio n. 1
0
def initChrome_PriceBlink(driver):
    try:
        isUrlLoaded = False
        refreshIndex = 0
        answer = driverStarter.effectiveGet(driver, Constances.url_priceblink)
        while answer == False and isUrlLoaded != True:
            refreshIndex = refreshIndex + 1
            answer = driverStarter.effectiveGet(driver, Constances.url_priceblink)
            if refreshIndex > Constances.MAXIMUM_NUMBER_OF_REFRESHES:
                isUrlLoaded = True
        if isUrlLoaded:
            return False
        time.sleep(10)
        # Click on the window
        pyautogui.click(1000, 15)
        time.sleep(2)
        # Add to chrome
        pyautogui.click(1472, 354)
        time.sleep(2)
        # Install
        pyautogui.click(999, 270)
        time.sleep(4)
        # Close the new tab after install priceBlink
        pyautogui.click(590, 19)
        time.sleep(2)
        # Close Chrome's declaretion to be automatically controlled
        pyautogui.click(1889, 116)
        time.sleep(2)
        return True
    except:
        return False
Esempio n. 2
0
def getTheProducts_multiURLs():
    print("Collecting from Amazon...")
    categories_index = 0
    # Get a WebDriver
    driver = driverStarter.startDriver()
    for url in Constances.amazon_categories:
        # Name of category
        category_name = Constances.categories_name_amazon[categories_index]
        answer = True
        driverStarter.effectiveGet(driver, url)
        numberOfPageCounter = 1
        while answer == True:
            content = driver.page_source
            # Encode & Decode the source data and decode again for string type only
            readable_content = content.encode(sys.stdout.encoding,
                                              errors='replace').decode(
                                                  'utf-8', errors='ignore')
            # Split and Seek products
            url_products = getTheProducts_singleURL(readable_content,
                                                    category_name)
            for product in url_products:
                # Adds the new products to the DataBase
                SQLHandler.addProduct(Constances.AMAZON_PRODUCTS_TABLE,
                                      product)
            answer = Tools.nextPage(driver)
            numberOfPageCounter = numberOfPageCounter + 1
            if numberOfPageCounter > Constances.LIMIT_NUMBER_OF_PAGE_TO_SEARCH:
                answer = False
        categories_index = categories_index + 1
    print("Finish Collecting from Amazon.")
    driver.close()
Esempio n. 3
0
def checkGapProducts():
    # Initialize
    driver = driverStarter.startDriver()
    # Get the gap products from data base
    GapData_AmazonEbay = SQLHandler.readAllTable(Constances.GAPS_AMAZON_EBAY_PRODUCTS_TABLE)
    for gapProduct in GapData_AmazonEbay:
        try:
            # Convert the hrefs from string type
            hrefs = gapProduct.hrefs.replace("[", "").replace("]", "").replace("'", "").replace(" ", "").split(",")
            names = splitName(gapProduct.names)
            names[0] = names[0].replace("'", "") # Amazon product name
            names[1] = names[1].replace("'", "") # Ebay product name
            imgs = gapProduct.imgs.replace("[", "").replace("]", "").replace("'", "").split(",")
            # Check if the gap product is already in Constances.STORE_PRODUCTS_TABLE
            isInStore = SQLHandler.isProduct(Constances.STORE_PRODUCTS_TABLE, [hrefs[0], hrefs[1]])
            if isInStore == False:
                if gapProduct.direction == 'Amazon_Dropshipping_Direction':
                    # The store should be open on Amazon while the product is being shipped from eBay
                    # Starts with the first href - Amazon site - Checking if the site is correct
                    isHrefAmazonCorrect = driverStarter.effectiveGet(driver, hrefs[0]) # Checking if the href is correct
                    if isHrefAmazonCorrect:
                        isCorrect_Amazon = checkIfPersonalSite_Amazon(driver) # Checking if product personal site
                        if isCorrect_Amazon == False: hrefs[0] = getTheCorrectSite_Amazon(driver, names[0], imgs[0])
                        isHrefEbayCorrect = driverStarter.effectiveGet(driver, hrefs[1]) # Ebay
                        if isHrefEbayCorrect:
                            # First - Checking if personal product site
                            isPersonal = checkIfPersonalSite_Ebay(driver)
                            if isPersonal:
                                ''' Just for this version - Only free shipping - Only USA!
                                # Checking the shipping details and options
                                shipping = checkShippingEbay(driver) # A browser must be open before with the appropriate site
                                # Just for this version - Only free shipping
                                if shipping == 'Free Shipping':
                                '''
                                # Safe to upload! - Add to data base
                                storeProduct = StoreProduct.Product(hrefs[0], hrefs[1], "Amazon", Constances.STATUS_NOT_UPLOAD)
                                SQLHandler.addProduct(Constances.STORE_PRODUCTS_TABLE, storeProduct)
                        else: deleteGap(gapProduct, "Ebay")
                    else: deleteGap(gapProduct, "Amazon")
                if gapProduct.direction == 'Ebay_Dropshipping_Direction':
                    # The store should be open on Ebay while the product is being shipped from Amazon
                    # Due to the structure of Ebay - there is no need to check if the site exists or is working properly
                    ''' Just for this version - Only free shipping - Only USA!
                    # Checking the shipping details and options in Amazon site
                    shipping = checkShippingAmazon(driver) # A browser must be open before with the appropriate site
                    # Just for this version - Only free shipping
                    # Selling only in USA
                    if shipping == 'Free Shipping':
                    '''
                    # Safe to upload! - Add to data base
                    storeProduct = StoreProduct.Product(hrefs[0], hrefs[1], "Ebay", Constances.STATUS_NOT_UPLOAD)
                    SQLHandler.addProduct(Constances.STORE_PRODUCTS_TABLE, storeProduct)
        except: None
Esempio n. 4
0
def initChrome_captcha_clicker(driver):
    try:
        isUrlLoaded = False
        refreshIndex = 0
        answer = driverStarter.effectiveGet(driver, Constances.url_captcha_clicker)
        while answer == False and isUrlLoaded != True:
            refreshIndex = refreshIndex + 1
            answer = driverStarter.effectiveGet(driver, Constances.url_captcha_clicker)
            if refreshIndex > Constances.MAXIMUM_NUMBER_OF_REFRESHES:
                isUrlLoaded = True
        if isUrlLoaded:
            return False
        time.sleep(15)
        # Click on Install
        pyautogui.click(416, 354)
        time.sleep(5)
        # Click on Install (popup)
        pyautogui.click(907, 272)
        time.sleep(5)
        return True
    except:
        return False
Esempio n. 5
0
def checkIfPersonalSite(href):
    global driver
    # Initializes
    isPersonalProductSite = False
    answer = driverStarter.effectiveGet(driver, href)
    if answer:
        # Gets the name by read the HTML source
        content = driver.page_source
        # Encode & Decode the source data and decode again for string type only
        readable_content = content.encode(sys.stdout.encoding,
                                          errors='replace').decode(
                                              'utf-8', errors='ignore')
        for char in readable_content:
            if char.isalpha() or ord(char) == Constances.SPACE_ASCII:
                word = word + char
            else:
                word = ""
            if word.lower() == Constances.KEY_SORT_PERSONAL_PRODUCT_SITE:
                isPersonalProductSite = True  # The URL address is a personal product site
        return isPersonalProductSite
    else:
        return isPersonalProductSite
Esempio n. 6
0
import sys
from Collection import Ebay
from Initialization import driverStarter

driver = driverStarter.startDriver()
url_ebay_Electronics_Search = 'https://www.ebay.com/sch/i.html?_sacat=0&_udlo=&_udhi=&_ftrt=901&_ftrv=1&_sabdlo=&_sabdhi=&_samilow=&_samihi=&_sadis=15&_stpos=22747&_sop=12&_dmd=1&_fosrp=1&LH_ItemCondition=3&_nkw=electronics&_pgn=1'
driverStarter.effectiveGet(driver, url_ebay_Electronics_Search)
content = driver.page_source
# Encode & Decode the source data and decode again for string type only
readable_content = content.encode(sys.stdout.encoding,
                                  errors='replace').decode('utf-8',
                                                           errors='ignore')
Ebay.getTheProducts_singleURL(readable_content, '')
Esempio n. 7
0
def uploadProducts():
    # Initialize
    storeProducts = SQLHandler.readAllTable(Constances.STORE_PRODUCTS_TABLE)
    # Open store at the specific location
    try:
        # Open the stores (Amazon and Ebay)
        # Just for this version - Manually!
        print(
            "Open Ebay store... (Please update 'UserOrders.txt' after finish!)"
        )
        ebayDriver = driverStarter.startDriver()
        driverStarter.effectiveGet(ebayDriver, Constances.EBAY_SITE)
        # Just for this version - The program knows the store are opened only when there is an update on DataBase
        answer = SQLHandler.isStoresOpen()
        while answer == False:
            answer = SQLHandler.isStoresOpen()
        # Update DataBase
        SQLHandler.updateUserOrderTable()
        print("The phase of opening store has ended")
    except Exception as e:
        print("The code stopped because: " + e)
    # Run over the data and uploading to Ebay store
    searchBarElement_Ebay = None
    continueElement_Ebay = None
    ignored_exceptions = (
        NoSuchElementException,
        StaleElementReferenceException,
    )
    for storeProduct in storeProducts:
        if storeProduct.status == Constances.STATUS_NOT_UPLOAD:
            if storeProduct.store_location == 'Ebay':  # Ebay cases
                # Gets the full data of the store product from gap products table
                gapProduct = SQLHandler.getStoreProductDetails(storeProduct)
                names = availableProduct.splitName(gapProduct.names)
                imgs = gapProduct.imgs.replace("[",
                                               "").replace("]", "").replace(
                                                   "'", "").split(", ")
                prices = gapProduct.prices.replace("[", "").replace(
                    "]", "").replace("'", "").split(", ")
                # In ebayDriver - search for the search bar element and searching for the name of the product
                if searchBarElement_Ebay == None:
                    iframe = ebayDriver.find_element_by_xpath(
                        Constances.EBAY_SELLING_PRODCUT_SEARCH_BAY_IFRAME)
                    ebayDriver.switch_to.frame(iframe)  # Switch to iframe
                    searchBarElement_Ebay = WebDriverWait(ebayDriver, 10, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.ID, Constances.EBAY_SELLING_PRODUCT_SEARCH_BAR_KEY)))
                searchBarElement_Ebay.send_keys(names[1] + "\n")  # Ebay
                # Continue to the 'Create a list' page
                if continueElement_Ebay == None:
                    continueElement_Ebay = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_PRODUCT_CONTINUE)))
                continueElement_Ebay.click()
                # Fills in the fields
                ebayDriver.switch_to.default_content(
                )  # Get out from the iframe
                #   UPC
                upcElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_UPC)))
                upcElement.click()
                #   Condition
                WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_UPC_OPTION_2))).click()
                conditionElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_CONDITION)))
                conditionElement.send_keys("New")
                #   Photos
                iframe = ebayDriver.find_element_by_id(
                    Constances.EBAY_SELLING_CREATE_A_LIST_PHOTOS_IFRAME)
                ebayDriver.switch_to.frame(iframe)  # Switch to iframe
                importFromWebElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_IMPORT_IMAGE_FROM_WEB)))
                importFromWebElement.click()
                enterImageURLElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_ENTER_IMAGE_URL)))
                enterImageURLElement.send_keys(
                    imgs[0])  # Using Amazon's product's image
                importImageButtonElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_IMPORT_IMAGE_BUTTON)))
                importImageButtonElement.click()
                ebayDriver.switch_to.default_content(
                )  # Get out from the iframe
                #   Brand
                brandElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_BRAND)))
                brandElement.send_keys("Unbranded")
                #   MPN
                MPNElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_MPN)))
                MPNElement.send_keys("Does Not Apply")
                #   Item description
                iframe = ebayDriver.find_element_by_id(
                    Constances.
                    EBAY_SELLING_CREATE_A_LIST_ITEM_DESCRIPTION_IFRAME)
                ebayDriver.switch_to.frame(iframe)  # Switch to iframe
                itemDescriptionElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_ITEM_DESCRIPTION_TEXT)))
                itemDescriptionElement.send_keys(
                    names[1]
                )  # Just for this version - The name is the item description
                ebayDriver.switch_to.default_content(
                )  # Get out from the iframe
                #   Selling details
                sellingDetailsElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_SELLING_DETAILS)))
                sellingDetailsElement.click()
                sellingDetailsElement.send_keys(Keys.DOWN)
                sellingDetailsElement.send_keys(9)  # Tab
                sellingDetailsElement.click()
                time.sleep(5)  # Saves and updates information
                priceElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_SELLING_DETAILS_PRICE)))
                pricesRatio = float(prices[0]) / float(
                    prices[1])  # The maximum profit price
                # Just for this version - 10% off from ebay price
                # For example - Amazon price (10$); Ebay price (15$)
                #               Maximum profit price is 5$ (pricesRatio = 0.666...)
                #               The price on our store (pricesRatio * 1.1 * EbayPrice = 11$)
                #               Our profit price is 4$
                priceElement.send_keys(
                    str(pricesRatio * 1.1 * float(prices[1])))
                payPalChooseElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                            .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_SELLING_PAYPAL)))
                payPalChooseElement.click()
                receivingPaymentEmailTextElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                                    .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_SELLING_RECEIVING_PAYMENT_EMAIL)))
                receivingPaymentEmailTextElement.send_keys(
                    Constances.AD_GINO_TEAM_EMAIL)

                #   Lists the item
                listItemElement = WebDriverWait(ebayDriver, 20, ignored_exceptions=ignored_exceptions)\
                                                    .until(EC.presence_of_element_located((By.XPATH, Constances.EBAY_SELLING_CREATE_A_LIST_LIST_ITEM)))
                listItemElement.click()
    print("Finish")  # Just for test
Esempio n. 8
0
import SQLHandler, Constances, time
from Entities import GapProduct
from Initialization import driverStarter

driver = driverStarter.startDriver()
GapData_AmazonEbay = SQLHandler.readAllTable(
    Constances.GAPS_AMAZON_EBAY_PRODUCTS_TABLE)
nameSimilarity = []
imgSimilarity_NumberOfMatch = []
imgSimilarity_Avg = []
for GapProduct in GapData_AmazonEbay:
    nameSimilarity.append(GapProduct.namesSimilar)
nameSimilarity.sort()
for sortedName in nameSimilarity:
    for GapProduct in GapData_AmazonEbay:
        imgSimilar = GapProduct.imgsSimilar.replace("(", "").replace(
            ")", "").replace("'", "").replace(" ", "").split(",")
        if (sortedName == GapProduct.namesSimilar and sortedName >= str(0.6)
                and imgSimilar[0] >= str(100) and imgSimilar[1] <= str(50)):
            print(sortedName)
            hrefs = GapProduct.hrefs.replace("[", "").replace("]", "").replace(
                "'", "").split(",")
            driverStarter.effectiveGet(driver, hrefs[0])  # Amazon
            time.sleep(2)
            driverStarter.effectiveGet(driver, hrefs[1])  # Ebay
            time.sleep(2)
Esempio n. 9
0
def nextPage(driver):
    # Get the current url
    currentPage = driver.current_url
    # Determents if is Amazon page or Ebat page
    urllist = urlparse(currentPage)
    website = urllist[1].replace('.com', '').lower()
    if 'amazon' in website:
        # Amazon page
        # First - Try to increase the number in the href
        newHref = tryIncreasePageNumber_Amazon(currentPage)
        try:
            driverStarter.effectiveGet(driver, newHref)
            if currentPage != driver.current_url:
                return True
            else:
                return False
        except:
            # Second - Scroll down and click on 'next page' button
            driver.execute_script("window.scrollTo(0, 0)")
            heightToScroll = 0
            tryCounting = 0
            try:
                last_height = driver.execute_script(
                    "return document.body.scrollHeight")
            except:
                last_height = Constances.DEFAULT_HEIGHT
            while heightToScroll <= Constances.MAX_HEIGHT:
                current_url = driver.current_url
                driver.execute_script(
                    "window.scrollTo(0, " +
                    str(int((last_height * 2) / 5) + heightToScroll) + ")")
                try:
                    blockPrint()
                    robo.click(Constances.IMAGE_PATH_AMAZON_NEXTPAGE,
                               timeout=Constances.SCROLL_TIME_LIMIT)
                    enablePrint()
                except:
                    try:
                        blockPrint()
                        robo.click(Constances.IMAGE_PATH_AMAZON_NEXTPAGE_2,
                                   timeout=Constances.SCROLL_TIME_LIMIT)
                        enablePrint()
                    except:
                        tryCounting = tryCounting + 1
                if int((last_height * 1) /
                       2) + heightToScroll >= int(last_height):
                    return False
                if tryCounting > Constances.MAX_NUMBER_OF_TRYING:
                    return False
                if current_url == driver.current_url:
                    heightToScroll = heightToScroll + Constances.SCROLL_INCREASE
                else:
                    return True
            return False
    if 'ebay' in website:
        # Ebay page
        answer = tryIncreasePageNumber_Ebay(currentPage)
        nextPageHref = fixHref_Ebay(answer)
        try:
            driverStarter.effectiveGet(driver, nextPageHref)
            if driver.current_url != nextPageHref:
                # Error in server detected. Refresh and try again
                driver.refresh()
                driverStarter.effectiveGet(driver, nextPageHref)
                if driver.current_url != nextPageHref:
                    return False
            return True
        except:
            return False
Esempio n. 10
0
import sys
from Collection import Amazon
from Initialization import driverStarter

driver = driverStarter.startDriver()
url_amazon_vehicles = 'https://www.amazon.com/b/ref=s9_acss_bw_cg_TGCGDK_3d1_w?node=276729011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=merchandised-search-15&pf_rd_r=FECH07WR2FC8EZYQK48Q&pf_rd_t=101&pf_rd_p=e7b0592f-ffeb-48c4-9453-25c721806001&pf_rd_i=165793011'
driverStarter.effectiveGet(driver, url_amazon_vehicles)
content = driver.page_source
# Encode & Decode the source data and decode again for string type only
readable_content = content.encode(sys.stdout.encoding,
                                  errors='replace').decode('utf-8',
                                                           errors='ignore')
Amazon.getTheProducts_singleURL(readable_content, 'ToyCars')
Esempio n. 11
0
import Constances, time, sys, os
from Navigation import Tools
from Initialization import driverStarter
from pyrobogui import robo
from urllib.parse import urlparse

url = 'https://www.ebay.com/b/Diecast-Toy-Vehicles/222/bn_1850842?rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&rt=nc&_pgn=166'
driver = driverStarter.startDriver()
driverStarter.effectiveGet(driver, url)
answer = True
last_height = heightToScroll = 0
while answer == True:
    currentPage = driver.current_url
    urllist = urlparse(currentPage)
    website = urllist[1].replace('.com', '').lower()
    if 'ebay' in website:
        # Ebay page
        answer = Tools.tryIncreasePageNumber_Ebay(currentPage)
        nextPageHref = Tools.fixHref_Ebay(answer)
        try:
            driverStarter.effectiveGet(driver, nextPageHref)
            if driver.current_url != nextPageHref:
                # Error in server detected. Refresh and try again
                driver.refresh()
                driverStarter.effectiveGet(driver, nextPageHref)
                if driver.current_url != nextPageHref:
                    answer = False
            else:
                answer = True
        except:
            answer = False
Esempio n. 12
0
def findGaps():
    global driver
    # Gets data from data base
    AmazonData = SQLHandler.readAllTable(Constances.AMAZON_PRODUCTS_TABLE)
    EbayData = SQLHandler.readAllTable(Constances.EBAY_PRODUCTS_TABLE)
    # Creates a driver
    driver = driverStarter.startDriver()
    # Install PriceBlink
    initialize_Tools.initChrome_PriceBlink(driver)
    # Checking Amazon
    for amazonProduct in AmazonData:
        answer = driverStarter.effectiveGet(driver, amazonProduct.href)
        if answer:
            try:
                start = time.time(
                )  # Start counting the time for all the gap products reference to amazonProduct
                # Switch and wait for PriceBlink iframe
                wait(driver, Constances.
                     PRICE_BLINK_TIME_TO_WAIT_FOR_TOOLBAR_TO_LOAD).until(
                         EC.frame_to_be_available_and_switch_to_it(
                             Constances.PRICE_BLINK_IFRAME_ID))
                # Looking for the compare price button
                for element in driver.find_elements_by_id("comparePricesBtn"):
                    comparePriceElement = element
                comparePriceElement.click()  # Open the list
                listOfProducts = comparePriceElement.find_element_by_class_name(
                    Constances.PRICE_BLINK_LIST_CLASS_NAME
                )  # Looking for the list by class name
                # Gets all the product from the list
                priceBlinkProducts = []
                for product in listOfProducts.find_elements_by_class_name(
                        Constances.PRICE_BLINK_PRODUCT_CLASS_NAME):
                    priceBlinkProducts.append(product)
                # Creates the gap product list
                # Gets the price and the href attributes that write in the text for each product
                gapProductList_BeforeTime = []
                for product in priceBlinkProducts:
                    try:
                        time.sleep(Constances.
                                   PRICE_BLINK_TIME_TO_WAIT_FOR_PRICES_TO_LOAD)
                        # Get the price and the shipping
                        priceText = product.text
                        price, shipping = getPriceFromText(
                            priceText)  # Get the price
                        if shipping == 'FREE': shipping = '0.0'
                        # Determing direction of dropshipping
                        if (shipping != None and
                            (float(price) + float(shipping) < float(
                                amazonProduct.price)) or
                            (shipping == None
                             and float(price) < float(amazonProduct.price))):
                            direction = 'Amazon_Dropshipping_Direction'
                        else:
                            direction = 'Ebay_Dropshipping_Direction'
                        # Try to get the href of the product
                        try:
                            href = None
                            for element in product.find_elements_by_xpath(
                                    ".//*"):
                                try:
                                    # Should be only one href attribute in the product
                                    href = element.get_attribute('href')
                                    break
                                except:
                                    None
                            if href != None:  # Found href
                                isPersonalSite = checkIfPersonalSite(
                                    amazonProduct.href
                                )  # Checking if the site is for personal product
                                if isPersonalSite:  # PriceBlink finds a gap!
                                    # Gets the product name
                                    ebayProductName = ""
                                    # Gets the product image
                                    ebayProductImage = ""
                                    # Category is the same as Amazon
                                    # Simialrity is not calculated (None for both names and images similarity)
                                    gapProductList_BeforeTime.append([
                                        str([
                                            amazonProduct.name, ebayProductName
                                        ]),
                                        str([amazonProduct.href, href]),
                                        str([
                                            amazonProduct.img, ebayProductImage
                                        ]),
                                        str([amazonProduct.price,
                                             price]), direction,
                                        amazonProduct.category, "None", "None"
                                    ])
                        except:
                            None
                    except:
                        None
                end = time.time()  # Stop counting the time
                searchingTimeAllProducts = end - start
                searchingTimeEachProduct = searchingTimeAllProducts / len(
                    gapProductList_BeforeTime)
                for gapProduct_BeforeTime in gapProductList_BeforeTime:
                    gapProduct = GapProduct.Product(
                        gapProduct_BeforeTime[0], gapProduct_BeforeTime[1],
                        gapProduct_BeforeTime[2], gapProduct_BeforeTime[3],
                        gapProduct_BeforeTime[4], gapProduct_BeforeTime[5],
                        searchingTimeEachProduct, gapProduct_BeforeTime[6],
                        gapProduct_BeforeTime[7])
                    SQLHandler.addProduct(
                        Constances.GAPS_AMAZON_EBAY_PRODUCTS_TABLE, gapProduct)
                # Switch back
                driver.switch_to.default_content()
            except:
                None
    # Checking Ebay
    for ebayProduct in EbayData:
        answer = driverStarter.effectiveGet(driver, ebayProduct.href)