Skip to content

Commit

Permalink
commits
Browse files Browse the repository at this point in the history
  • Loading branch information
champion10874 committed Sep 2, 2024
1 parent c0b1187 commit 99ee17b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Amazon/amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
driver = webdriver.Chrome()
driver.maximize_window()

# Import data from file
inputs = openpyxl.load_workbook('entrada.xlsx')
sheet = inputs.active
site_name = sheet.cell(row = 2, column = 1).value
Expand All @@ -20,6 +21,7 @@
print("Senha: ", password)
print("Número total de produtos: ", num_of_products)

# Setting directory
if not os.path.exists('captura de tela'):
os.makedirs('captura de tela')

Expand All @@ -44,11 +46,13 @@
func.find_element(driver, By.ID, "ap_password").send_keys(password)
func.find_element(driver, By.ID, "signInSubmit").click()

# For Captcha
while True:
response = input("Did you pass the character? (y/n): ")
if response == 'y':
break

# Start for each item
match_num = 0
for i in range(num_of_products):
sleep(0.3)
Expand Down Expand Up @@ -125,7 +129,8 @@
driver.find_element(By.ID, 'dp').screenshot('captura de tela/{}'.format(image_name))
except:
image_name = "Não encontrado"


# Save result
workbook = openpyxl.load_workbook('resultado.xlsx')
sheet = workbook['Sheet']
sheet[f'A{match_num + 1}'] = site_name
Expand Down

0 comments on commit 99ee17b

Please sign in to comment.