不廢話,直接進入主題,本次演示如何啟動chrome,且指定默認的profile
成都創(chuàng)新互聯(lián)公司是一家專業(yè)提供紅塔企業(yè)網(wǎng)站建設,專注與成都網(wǎng)站建設、做網(wǎng)站、html5、小程序制作等業(yè)務。10年已為紅塔眾多企業(yè)、政府機構等服務。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設計公司優(yōu)惠進行中。
下載chromedriver
地址:http://chromedriver.storage.googleapis.com/index.html?path=2.33/
特別注意:看notes.txt注意版本號一定要匹配啊,如果chromedriver版本和你的chrome版本不匹配那就可能啟動不了!?。。。?/p>
實戰(zhàn)代碼
from selenium import webdriver path="chromedriver.exe所在的完整路徑" option=webdriver.ChromeOptions() #用chrome地址欄輸入chrome://version/,查看自己的【個人資料路徑】 option.add_argument('--user-data-dir=上面查看的個人資料路徑寫這里') driver=webdriver.Chrome(executable_path=path,chrome_options=option) #return driver
文章名稱:pythonseleniumwebdriver啟動chrome瀏覽器的方法
瀏覽路徑:http://chinadenli.net/article18/podhdp.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供響應式網(wǎng)站、企業(yè)網(wǎng)站制作、自適應網(wǎng)站、標簽優(yōu)化、虛擬主機、全網(wǎng)營銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)