Esempio n. 1
0
def process(inputList):
    shop = "Press Start Games"
    results = []
    try:
        basicUrl = "https://www.press-startgames.com/c-3103097/complete-cib-pal/"
        pageUrl = "https://www.press-startgames.com/c-3103097-{0}/complete-cib-pal/"

        source = requests.get(basicUrl).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('div', class_='page-selection')
        size = pageSelection.findAll('li')[-2].text

        for x in range(1, int(size) + 1):
            sourceUrl = pageUrl.format(x) if x != 1 else basicUrl
            source = requests.get(sourceUrl).text
            soup = BeautifulSoup(source, 'lxml')
            for li in soup.findAll(
                    'li', id=lambda x: x and x.startswith('article_')):
                title = li.find('a', class_='title').text.strip()
                pricetag = li.find('span', class_='pricetag')
                price = pricetag.span.text.strip()
                url = li.find('a', class_='image')['href']

                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(GameResult(title, price, url, shop))
        '''run for ntsc put this in common function'''
        basicUrl = "https://www.press-startgames.com/c-3103098/complete-cib-ntsc/"
        pageUrl = "https://www.press-startgames.com/c-3103098-{0}/complete-cib-ntsc/"

        source = requests.get(basicUrl).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('div', class_='page-selection')
        if pageSelection is None:
            size = 1
        else:
            size = pageSelection.findAll('li')[-2].text

        for x in range(1, int(size) + 1):
            sourceUrl = pageUrl.format(x) if x != 1 else basicUrl
            source = requests.get(sourceUrl).text
            soup = BeautifulSoup(source, 'lxml')
            for li in soup.findAll(
                    'li', id=lambda x: x and x.startswith('article_')):
                title = li.find('a', class_='title').text.strip()
                pricetag = li.find('span', class_='pricetag')
                price = pricetag.span.text.strip()
                url = li.find('a', class_='image')['href']

                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(GameResult(title, price, url, shop))

        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results
Esempio n. 2
0
def process(inputList):
    shop = "Gameland-Groningen"
    results = []
    try:
        begin = 1
        basicUrl = "https://www.gameland-groningen.nl/nl/xbox/xbox-classic/games/page{0}.html"

        source = requests.get(basicUrl.format(begin)).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('span', class_='page-product-count').text.strip()
        increment = soup.find('span', class_='page-info').find('option', selected=True).text.strip()
        total = int(pageSelection)
        total = total / int(increment)

        for x in range(1, math.ceil(total)+1):
            if x > 1:
                source = requests.get(basicUrl.format(x)).text
                soup = BeautifulSoup(source, 'lxml')
            for div in soup.findAll('div', class_='product'):
                title = div.find('div', class_='info').find('a').text.strip()
                price = div.find('span', class_='new-price').text.strip()
                url = div.find('div', class_='info').find('a')['href'] 
                res = functions.titlePresent(title,inputList)
                if res:
                    results.append(GameResult(title,price,url,shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR","404","",shop))
        return results
Esempio n. 3
0
def runInternal(inputList):
    shop = "NedGame"
    results = []
    try:
        global next
        global source
        global soup
        global pageIndex
        
        basicUrl = "https://www.nedgame.nl/xbox/games/&aantal=100&pagina={0}"
        source = requests.get(basicUrl.format(pageIndex)).text
        soup = BeautifulSoup(source, 'lxml')

        for tr in soup.findAll('tr', id=lambda x: x and x.startswith('prod_id')):
            titleDiv = tr.find('div', class_='titlewrapper')
            title = titleDiv.find('h3').text.strip()
            price = tr.find('div', class_='currentprice').text.strip()
            url = titleDiv.find('a')['href'] 
            res = functions.titlePresent(title,inputList)
            if res:
                results.append(GameResult(title,price,url,shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR","404","",shop))
        return results
Esempio n. 4
0
def process(inputList):
    shop = "RetroGamesCorner"
    results = []
    try:
        begin = 1
        increment = 24

        basicUrl = "https://www.retrogamescorner.com/44-xbox?page={0}"

        source = requests.get(basicUrl.format(begin)).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('div', class_='total-products').text.strip()
        total = int(re.findall(r'\d+', pageSelection)[-1])
        total = total / increment

        for x in range(1, math.ceil(total) + 1):
            if x > 1:
                source = requests.get(basicUrl.format(x)).text
                soup = BeautifulSoup(source, 'lxml')

            for article in soup.findAll('article', class_='product-miniature'):
                title = article.find(
                    'h1', class_='product-title').find('a').text.strip()
                price = article.find('span', class_='price').text.strip()
                url = article.find('h1',
                                   class_='product-title').find('a')['href']
                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(GameResult(title, price, url, shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results
Esempio n. 5
0
def process(inputList):
    shop = "GamesEnCo"
    results = []
    try:
        begin = 1
        increment = 20
    
        basicUrl = "https://www.gamesenco.be/product-categorie/xbox-2/xbox/page/{0}"

        source = requests.get(basicUrl.format(begin)).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('p', class_='woocommerce-result-count').text.strip()
        total = int(re.findall(r'\d+', pageSelection)[-1])
        total = total / increment

        for x in range(1, math.ceil(total)+1):
            if x > 1:
                source = requests.get(basicUrl.format(x)).text
                soup = BeautifulSoup(source, 'lxml')
            
            ul = soup.find('ul', class_='products')
            for li in ul.findAll('li', class_='product'):
                title = li.find('h2', class_='woocommerce-loop-product__title').text.strip()
                price = li.find('span', class_='woocommerce-Price-amount').text.strip()
                url = li.find('a')['href'] 
                res = functions.titlePresent(title,inputList)
                if res:
                    results.append(GameResult(title,price,url,shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR","404","",shop))
        return results
Esempio n. 6
0
def process(inputList):
    shop = "RetroGameKing"
    results = []
    try:
        begin = 1
        increment = 60
        basicUrl = "https://www.retrogameking.com/epages/78704979.sf/nl_NL/?ViewAction=View&ObjectPath=/Shops/78704979/Categories/Xbox/Xbox_Games&PageSize={1}&Page={0}"
        source = requests.get(basicUrl.format(begin, increment)).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('ul', class_='PagerSizeContainer')
        size = pageSelection.findAll('li')[-2].text

        for x in range(1, int(size) + 1):
            if x > 1:
                source = requests.get(basicUrl.format(x, increment)).text
                soup = BeautifulSoup(source, 'lxml')

            for div in soup.findAll('div', class_='InfoArea'):
                title = div.find('h3').find('a').text.strip()
                pricetag = div.find('span', class_='price-value')
                price = pricetag.span.text.strip()
                url = div.find('h3').find('a')['href']

                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(
                        GameResult(
                            title, price,
                            "https://www.retrogameking.com/epages/78704979.sf/nl_NL/"
                            + url, shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results
Esempio n. 7
0
def process(inputList):
    shop = "Lamar Games"
    results = []
    try:
        basicUrl = "https://www.lamargames.nl/c-1312737/xbox-classic-games/"
        pageUrl = "https://www.lamargames.nl/c-1312737-{0}/xbox-classic-games/?sort_order=ascending&sort_method=by_relevance"

        source = requests.get(basicUrl).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('div', class_='page-selection')
        size = pageSelection.findAll('li')[-2].text

        for x in range(1, int(size) + 1):
            sourceUrl = pageUrl.format(x) if x != 1 else basicUrl
            source = requests.get(sourceUrl).text
            soup = BeautifulSoup(source, 'lxml')
            for li in soup.findAll(
                    'li', id=lambda x: x and x.startswith('article_')):
                title = li.find('a', class_='title').text.strip()
                pricetag = li.find('span', class_='pricetag')
                price = pricetag.span.text.strip()
                url = li.find('a', class_='image')['href']

                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(GameResult(title, price, url, shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results
Esempio n. 8
0
def process(inputList):
    shop = "Passion For Games"
    results = []
    try:
        begin = 1
        basicUrl = "https://www.gamewebshop.eu/en/xbox/page{0}.html"
        source = requests.get(basicUrl.format(begin)).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('div', class_='pagination-container')
        size = pageSelection.findAll('li')[-2].text

        for x in range(1, int(size) + 1):
            if x > 1:
                source = requests.get(basicUrl.format(x)).text
                soup = BeautifulSoup(source, 'lxml')

            for div in soup.findAll('div', class_='product'):
                title = div.find('h3').find('a').text.strip()
                pricetag = div.find('div', class_='product-price')
                price = pricetag.span.text.strip()
                url = div.find('h3').find('a')['href']

                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(GameResult(title, price, url, shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results
Esempio n. 9
0
def process(inputList):
    shop = "JPRS Games"
    results = []
    try:
        begin = 1
        end = 40
        increment = 39

        basicUrl = "https://jprsgames.nl/index.php/xbox/games2013-04-03-09-00-102013-04-03-09-00-10-3/results,{0}-{1}"

        source = requests.get(basicUrl.format(begin, end)).text
        soup = BeautifulSoup(source, 'lxml')
        pageSelection = soup.find('div',
                                  class_='display-number').contents[0].strip()
        total = int(next(re.finditer(r'\d+$',
                                     pageSelection)).group(0)) + increment

        while end < total:
            if begin > 1:
                source = requests.get(basicUrl.format(begin, end)).text
                soup = BeautifulSoup(source, 'lxml')

            for div in soup.findAll('div', class_='product'):
                titleDiv = div.find('div',
                                    class_=lambda x: x and x.startswith(
                                        'vm-product-descr-container'))
                title = titleDiv.find('h2').text.strip()
                price = div.find('span', class_='PricesalesPrice').text.strip()
                url = titleDiv.find('h2').find('a')['href']
                res = functions.titlePresent(title, inputList)
                if res:
                    results.append(
                        GameResult(title, price, 'https://jprsgames.nl' + url,
                                   shop))

            begin = begin + 39
            end = end + 39
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results
Esempio n. 10
0
def process(inputList):
    shop = "Gameshop-Twente"
    results = []
    try:
        begin = 1
        increment = 16

        basicUrl = "https://www.gameshop-twente.nl/inhoudZoeken.php?blz={0}&&maxAantalResults={1}&&productgroep=&&systeem=Genre_Games&&genre=&&actie=navbar_klik&&tagNegeer=niets&&meegekregenTermen=_@Systeem@XBX_@Groep@Games"
        source = requests.get(basicUrl.format(begin, increment)).text
        soup = BeautifulSoup(source, 'lxml')
        pages = soup.find('input', id='aantalBladzijden')['value']

        for x in range(1, int(pages) + 1):
            if x > 1:
                source = requests.get(basicUrl.format(x, increment)).text
                soup = BeautifulSoup(source, 'lxml')

            for div in soup.findAll('div', id='browse_resultbox_zoekpagina'):
                title = div.find('table').find('a').text.strip()
                prices = div.findAll('div', class_='genoegVoorraad')
                if len(prices) > 0:
                    price = ""
                    for i in prices:
                        price = price + i.find(
                            'span', id='prijs_center').text.strip() + " "
                    url = div.find('table').find('a')['href']
                    res = functions.titlePresent(title, inputList)
                    if res:
                        results.append(
                            GameResult(title, price,
                                       "https://www.gameshop-twente.nl/" + url,
                                       shop))
        return results
    except:
        print(sys.exc_info()[0])
        results.append(GameResult("ERROR", "404", "", shop))
        return results