SeleniumBasic icon indicating copy to clipboard operation
SeleniumBasic copied to clipboard

load page without image

Open Waker-fr opened this issue 5 years ago • 1 comments

Hello,

In order to run my code faster, I would like to know how to load pages without images. I think I can do that with Driver.SetPreference but I can't figure how I am supposed to do.

I found many things in python like chromeOptions = webdriver.ChromeOptions() prefs = {'profile.managed_default_content_settings.images':2} chromeOptions.add_experimental_option("prefs", prefs) driver = webdriver.Chrome(chrome_options=chromeOptions) but I don't know how to translate it in VBA

Maybe the solution is to go trough a chrome profile but I can't figure out how too.

Waker-fr avatar Feb 27 '19 15:02 Waker-fr

When SeleniumBasic runs by default it creates a new instance of browser with a new profile. You can force it to use an existing profile.

Dim drv As Selenium.WebDriver
Dim drvChrome As ChromeDriver
Set drvChrome = New ChromeDriver
Set drv = drvChrome
drv.SetProfile "MyProfile", persistant:=True

You can manually change this profile to not load images.

mogulman52 avatar Mar 25 '19 13:03 mogulman52