-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9844dab
Showing
6,587 changed files
with
962,507 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import re | ||
def cleanName(texto_fila): | ||
sin_numeros = re.sub(r'\d+', '', texto_fila) | ||
return sin_numeros | ||
|
||
def claneNameTrim(texto): | ||
t = texto.split('\n', 1)[0] | ||
return t |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import datetime | ||
import pytz | ||
|
||
def fechaYhora(): | ||
mi_zona_horaria = pytz.timezone('America/Santiago') | ||
now = datetime.datetime.now(mi_zona_horaria) | ||
hora_actual = now.strftime("%H:%M:%S") | ||
fecha_actual = now.strftime("%Y-%m-%d") | ||
fecha = f"{fecha_actual} {hora_actual}" | ||
return fecha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import re | ||
def getId(txt): | ||
id_juego = re.findall(r'\d+', txt)[0] | ||
return id_juego |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import requests | ||
from proxyListGen import proxyListCheck | ||
def buscarEn(url): | ||
try: | ||
triesList = [] | ||
prox = proxyListCheck() | ||
proxy = f"{prox[0]}:{prox[1]}" | ||
session = requests.Session() | ||
while True: | ||
try: | ||
r = session.get(url, proxies={'http':proxy, 'https':proxy}, timeout=7) | ||
break | ||
except requests.exceptions.RequestException as err: | ||
triesList.append(proxy) | ||
prox = proxyListCheck() | ||
proxy = f"{prox[0]}:{prox[1]}" | ||
if proxy in triesList: | ||
while proxy not in triesList: | ||
prox = proxyListCheck() | ||
proxy = f"{prox[0]}:{prox[1]}" | ||
session = requests.Session() | ||
if r.status_code == 200: | ||
return proxy | ||
else: | ||
while True: | ||
try: | ||
r = session.get(url, proxies={'http':proxy, 'https':proxy}, timeout=3) | ||
break | ||
except requests.exceptions.RequestException as err: | ||
triesList.append(proxy) | ||
prox = proxyListCheck() | ||
proxy = f"{prox[0]}:{prox[1]}" | ||
if proxy in triesList: | ||
while proxy not in triesList: | ||
prox = proxyListCheck() | ||
proxy = f"{prox[0]}:{prox[1]}" | ||
session = requests.Session() | ||
return proxy | ||
except requests.exceptions.RequestException as err: | ||
print(err, 'HeaderGen') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
def hrefNameProcessor(href): | ||
# Extraer la parte después de 'steam-' | ||
contenido = href.split('steam-')[1] | ||
|
||
# Si hay un segundo 'steam-' o final del segmento de la URL, cortar allí | ||
if '-steam' in contenido: | ||
contenido = contenido.split('-steam')[0] | ||
|
||
# Reemplazar guiones por espacios para un nombre más legible | ||
contenido_limpio = contenido.replace('-', ' ') | ||
return contenido_limpio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from main import scrap | ||
|
||
juego = scrap('dark souls') | ||
print(juego) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from seleniumbase import SB | ||
import re | ||
from urlTransformer import juegoURL | ||
from cleanName import cleanName, claneNameTrim | ||
from priceProcess import priceProcess | ||
from hrefNameProcessor import hrefNameProcessor | ||
from getId import getId | ||
from fechaYhora import fechaYhora | ||
|
||
def scrap(juego): | ||
with SB(uc=True, headless=True) as sb: | ||
try: | ||
nombreJuego = juegoURL(juego) | ||
url = f"https://www.eneba.com/latam/store/all?text={nombreJuego}&enb_campaign=Main%20Search&enb_content=search%20dropdown%20-%20input&enb_medium=input&enb_source=https%3A%2F%2Fwww.eneba.com%2F&enb_term=Submit" | ||
sb.get(url) | ||
cards = sb.find_elements('.oSVLlh') | ||
price = sb.find_elements('css selector', '.L5ErLT') | ||
names = [] | ||
prices = [] | ||
plataforma = [] | ||
fecha = [] | ||
games = [] | ||
for i in cards: | ||
name = i.get_attribute('href') | ||
if name and 'steam' in name: | ||
hrefLimpio = hrefNameProcessor(name) | ||
names.append(hrefLimpio) | ||
plataforma.append('steamDB') | ||
date = fechaYhora() | ||
fecha.append(date) | ||
for i in price: | ||
prices.append(i.text) | ||
for n, pr, pl, fe in zip(names, prices, plataforma, fecha): | ||
obj = { | ||
"juego": n, | ||
"precio": pr, | ||
"plataforma": pl, | ||
"fecha": fe | ||
} | ||
games.append(obj) | ||
return games | ||
except ValueError as err: | ||
print(err) | ||
scrap('dark souls') | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from bs4 import BeautifulSoup | ||
|
||
def priceProcess(): | ||
|
||
with open('pagina_steamdb.txt', 'r', encoding='utf-8') as file: | ||
html_content = file.read() | ||
soup = BeautifulSoup(html_content, 'html.parser') | ||
price_div = soup.find('div', class_='single-price-line') | ||
if price_div: | ||
price_span = price_div.find('span') | ||
if price_span: | ||
precio_juego = price_span.text | ||
return precio_juego | ||
else: | ||
print('No se encontró el <span> con el precio.') | ||
else: | ||
print('No se encontró el div con la clase "single-price-line".') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
seleniumbase==4.31.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def juegoURL(juego): | ||
x = juego.replace(' ', '%20') | ||
return x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright 2006 Dan-Haim. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
3. Neither the name of Dan Haim nor the names of his contributors may be used | ||
to endorse or promote products derived from this software without specific | ||
prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED | ||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA | ||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | ||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. |
Oops, something went wrong.