赞
踩
chrome.exe --remote-debugging-port=9222
127.0.0.1:9222/json
from selenium.webdriver.chrome.options import Options
chrome_option=Options()
chrome_option.add_argument("--disable-extensions")
chrome_option.add_experimental_option("debuggerAddress", "127.0.0.1:9222")
# path为chromedriver的路径
browser = webdriver.Chrome(executable_path="path",
chrome_options=chrome_option)
# url 为需要爬取的网址
browser.get(url)
如果想实现静默状态下,即不显示浏览器界面,可添加参数
chrome_option.add_argument('headless')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。