打开连接后,执行driver.close() 关闭浏览器没有关闭浏览器呀

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import time
url= 'http://www.imooc.com'
user_name = '13522919192'
password = 'liying0815'
driver=webdriver.Chrome()
driver.get(url)
driver.maximize_window()
driver.find_element_by_id('js-signin-btn').click()
time.sleep(2)
time.sleep(3)
driver.find_element_by_name('email').send_keys(user_name)
driver.find_element_by_name('password').send_keys(password)
driver.find_element_by_class_name('moco-btn').click()
time.sleep(3)


driver.find_element_by_link_text("猿问").click()
time.sleep(2)

"""
提问
"""
'''
#1  NG invalid selector: Compound class names not permitted
#driver.find_element_by_class_name("moco-btn moco-btn-green").click()
#que-btn clearfix r

#2 ok  driver.find_element_by_class_name("moco-btn moco-btn-green").click()
t1 =driver.find_element_by_class_name("que-btn")
t1.find_element_by_class_name("moco-btn").click()

#3 OK
driver.find_element_by_xpath('//a[@class="moco-btn moco-btn-green"]')


#4 OK
driver.find_element_by_css_selector("a.moco-btn").click()
'''

#5
driver.find_element_by_link_text("提问").click()
time.sleep(2)
driver.close()
print("You are ")


李颖1908524
浏览 1354回答 0
0回答

慕斯4360584

PGQAHWQQRBSNUKOSBRSCWDOCMAUPVZNILADEZHRFJKKQRHYSYMCSLIPIZSMDQQHOIQGWNFMRBSTNKSOOYMISXBGDNKQKBIWNXRXZTMNSJWDKZCBUUNDBFIWGHKPDKURAXNYIVUOGBSAHHRLXWFFFXXEYDNMMCGGXWTJKUQMGGXEUSCQTIWWAAOEOSWBCRRTQXUDOBVDMPLLASIMWAFIICPISSJDDEOBFSZUBMJOUNKIHRILTOPTMNHEVDDECYRPVOLUZQAOCRYPKRYGARTRQOKGDBFTKGXEBBGKZMHIZLPMPRLRIDUMTAOYGHVFNTOGVYDVRGKFMFHOCTHIMNLCXVTDBMRYRZAYDAKLZITLEPNBYVVQYZQGESAGNAYTKOCBCKXLVNLMTHJBPMWFGYKVCXLQHIPHSGVJJYMHBFGXFGJNEEADXFQZXJX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