KS3 计算机/项目创意/黑客应用程序/查找解决方案-查找数字
外观
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://www.google.com'
browser.get(url)
open the page http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl
答案
修改此代码
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
browser.get(url)
browser.get(url)
browser.get(url)
browser.get(url)
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
num = 0
while num < 5:
browser.get(url)
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(111)
form = browser.find_element_by_name('F')
form.submit()
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(111)
form = browser.find_element_by_name('F')
form.submit()
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(112)
form = browser.find_element_by_name('F')
form.submit()
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(113)
form = browser.find_element_by_name('F')
form.submit()
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(114)
form = browser.find_element_by_name('F')
form.submit()
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(115)
form = browser.find_element_by_name('F')
form.submit()
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
def try_Number (value):
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(value)
form = browser.find_element_by_name('F')
form.submit()
try_Number(111)
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
def try_Number (value):
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(value)
form = browser.find_element_by_name('F')
form.submit()
try_Number(111)
try_Number(112)
try_Number(113)
try_Number(114)
try_Number(115)
答案
from selenium import webdriver
browser = webdriver.Firefox()
url = 'http://vicnum.ciphertechs.com/cgi-bin/guessnum1.pl'
browser.get(url)
def try_Number (value):
elem = browser.find_element_by_name('userguess') # Find the search box
elem.send_keys(value)
form = browser.find_element_by_name('F')
form.submit()
num = 0
while num < 10:
try_Number("00" + str(num))
num += 1