Всем привет,можете пожалуйста подсказать как правильно передать данные логина и пароля в каждый браузер?Сейчас в 4 браузера передаются данные ( kira , sdfds) .Заранее благодарен.
def get_data(url):
driver_path = r"D:\ProgramApp\chromedriver\chromedriver.exe"
driver = webdriver.Chrome(executable_path=driver_path)
driver.get(url=url)
actions = ActionChains(driver)
driver.implicitly_wait(10)
time.sleep(2)
df = pandas.read_excel('aro.xlsx')
for _, data in df.iterrows():
end_log = data.login
end_pass = data.password
print('Login',end_log)
print('Password',end_pass)
login = driver.find_element(By.XPATH,
"//div[@class='account-body-tabs']//li[@class='account-tab-account']")
actions = ActionChains(driver)
actions.move_to_element(login)
actions.click(login)
actions.perform()
account = driver.find_element(By.ID, "username")
actions.move_to_element(account)
actions.send_keys_to_element(account, end_log)
actions.perform()
actions = ActionChains(driver)
password = driver.find_element(By.ID, "password")
actions.move_to_element(password)
actions.send_keys_to_element(password, end_pass)
actions.perform()
time.sleep(1000)
if __name__ == '__main__':
url = 'https://accounts.douban.com/passport/login_popup?login_source=anony'
wb = load_workbook('aro.xlsx')
sheet_ranges = wb['Sheet1']
login = sheet_ranges['A']
password = sheet_ranges['B']
if len(login) == len(password):
process_count = len(login)
urls_list = [url] * process_count
print(process_count)
p = Pool(processes=process_count)
p.map(get_data,urls_list)