selenium自动化图片不加载设置
生活随笔
收集整理的這篇文章主要介紹了
selenium自动化图片不加载设置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
設置selenium自動化Chrome瀏覽器的圖片不加載 2就是不加載
options = webdriver.ChromeOptions() prefs = {'profile.default_content_setting_values': {'images': 2,}} options.add_experimental_option('prefs', prefs)設置無界面瀏覽器
options.add_argument('--headless')最大化瀏覽器
browser.maximize_window()為selenium添加cookie
browser.add_cookie(字典類型的參數,例子:'name': c['name'],'value': c['value'],'path': '/','expires': None)講瀏覽器拉倒底部
browser.execute_script('window.scrollTo(0,document.body.scrollHeight)')顯式等待
wait = WebDriverWait(self.browser, timeout=10) wait.until(EC.presence_of_element_located((By.XPATH, 'XPATH代碼')))總結
以上是生活随笔為你收集整理的selenium自动化图片不加载设置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Lineage Logistics完成对
- 下一篇: Rust更适合经验较少的程序员?