Skip to content

Commit 01c7466

Browse files
committed
Modificações
1 parent 98cb037 commit 01c7466

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

raspamb.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
import requests
77
except:
88
try:
9-
os.system("pip install requests")
9+
os.system('pip install requests')
1010
except:
11-
os.system("sudo pip install requests")
11+
os.system('sudo pip install requests')
1212
try:
1313
from bs4 import BeautifulSoup
1414
except:
1515
try:
16-
os.system("pip install bs4")
16+
os.system('pip install bs4')
1717
from bs4 import BeautifulSoup
1818
except:
19-
os.system("sudo pip install bs4")
19+
os.system('sudo pip install bs4')
2020
from bs4 import BeautifulSoup
2121

2222
try:
@@ -33,8 +33,11 @@
3333
from selenium.common.exceptions import WebDriverException
3434

3535

36-
3736
def drive_download():
37+
'''
38+
Esta função é responsavel por localizar a versão mais recente do Chrome Driver na internet e realiza o download
39+
'''
40+
3841
version = requests.get("http://chromedriver.storage.googleapis.com/LATEST_RELEASE").text
3942

4043
if platform.system() == "Windows":
@@ -54,11 +57,15 @@ def drive_download():
5457

5558

5659
def localizar_driver():
60+
'''
61+
Esta função localiza o driver no computador do usuário
62+
'''
63+
5764
if os.path.isfile('chromedriver') or os.path.isfile('chromedriver.exe'):
5865
if os.name == 'posix':
5966
# Retorna o driver nos sistas operacionais posix(ubuntu, etc...)
6067
return webdriver.Chrome(os.getcwd() + '/chromedriver')
61-
elif if platform.system() == "Windows":
68+
elif platform.system() == 'Windows':
6269
# Retorna o driver no sistema operacional windows
6370
return webdriver.Chrome(executable_path=os.getcwd() + '\chromedriver.exe')
6471
else:
@@ -87,7 +94,6 @@ def links_zippyshare():
8794

8895

8996
print('A execução do código pode demorar de acordo com a internet')
90-
print()
9197
url = 'https://www.anbient.com/anime/lista'
9298

9399
html = urlopen(url)
@@ -169,7 +175,6 @@ def retornar_busca():
169175
# Le o numero do episódio que ira baixar
170176
while True:
171177
try:
172-
print()
173178
numero_episodio = int(input('Número do episódio (-1 para voltar): '))
174179
if numero_episodio == -1:
175180
retornar_busca()
@@ -181,8 +186,7 @@ def retornar_busca():
181186
except ValueError:
182187
print('''!!!! Atenção !!!! Erro no número''')
183188

184-
print('Iniciando o download')
185-
print()
189+
print('Iniciando o download\n')
186190
driver.get(link)
187191
sopa = BeautifulSoup(driver.page_source, 'html.parser')
188192
zip_link = sopa.find_all("a", id=True)

0 commit comments

Comments
 (0)