2017-04-04 34 views
1

我想硒與之前給出的答案send_keys的輸入問題的Python,硒:send_keys(「以前給定的輸入答案」)

這是我的代碼:

import urllib 
import re 
import sys 
import time 
import pyautogui 
import threading 
import os 
import subprocess 
from selenium import webdriver 

print("Hello and Welcome to the automated usenet account creator script") 
time.sleep(0.8) 
question1 = input ("Email Adress: ") 

driver = webdriver.Chrome() 

driver.get("https://www.5eurousenet.com/nl/cart/checkout") 

time.sleep(1) 

#email 
email = driver.find_element_by_id('edit-panes-customer-primary-email') 
email.send_keys("ANSWER TO question1") 
quit() 

請幫幫我!

回答

0

question1變量是用戶輸入的電子郵件值。您應該將它作爲參數傳遞給send_keys()

email.send_keys(question1) 
+0

非常感謝:) –

相關問題