selenium 配置 360极速浏览器(支持NPAPI)

#coding:utf-8
#配置前先将谷歌的chromedriver放到 360浏览器的目录下
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time

__browser_url = r'D:\360极速浏览器\360Chrome\Chrome\Application\360chrome.exe' #浏览器目录地址
chrome_options = Options()
chrome_options.binary_location = __browser_url
brower = webdriver.Chrome(chrome_options=chrome_options)

#brower = webdriver.Firefox()
brower.get("http://www.baidu.com")

brower.find_element_by_id('kw').send_keys('selenium')
brower.find_element_by_id('su').click()

time.sleep(3)
brower.close()

你可能感兴趣的:(功能类型)