webdriervAPI (acquired authentication information)

from  selenium  import  webdriver

driver  =  webdriver.Chorme()

driver.get("http://www.baidu.com")

 

Several of the most commonly used authentication information are the title, URL and text to get the text message.

 

Print the current page URL

now_url  =  driver.current.url

 

Print the title

now_title  =  driver.title

 

Print the specified text as verification information, such as username, log out, exit

driver.find_element_by_id(" ").text

 

driver.close () Close the current page

driver.quit () to exit the browser

Guess you like

Origin www.cnblogs.com/97xiaolai/p/11707415.html