def open_browser(browser):
if browser == ‘chrome’:
driver = webdriver.Chrome()
elif browser == ‘firefox’:
driver = webdriver.Firefox()
elif browser == ‘ie’:
driver = webdriver.Ie()
else:
driver = webdriver.Edge()
return driver
def get_url(url):
driver = webdriver.Chrome()
if driver is not None:
driver.maximize_window()
if “http” in url:
driver.get(url)
else:
print(“你传入的参数有问题”)
else:
print(“case失败”)