ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.58k stars 1.14k forks source link

How to disable image loads to save bandwidth? #194

Open githubtrip opened 3 years ago

githubtrip commented 3 years ago

How to disable image loads to save bandwidth? Good residential proxies are expensive so want to know if its possible to disable loading of images

pawanpaudel93 commented 3 years ago

@githubtrip Do this for chromedriver.

` chrome_prefs = {}

chrome_prefs["profile.default_content_settings"] = {"images": 2}

chrome_prefs["profile.managed_default_content_settings"] = {"images": 2}

options.add_experimental_option('prefs', chrome_prefs) `

go8go commented 3 years ago

@githubtrip Do this for chromedriver.

` chrome_prefs = {}

chrome_prefs["profile.default_content_settings"] = {"images": 2}

chrome_prefs["profile.managed_default_content_settings"] = {"images": 2}

options.add_experimental_option('prefs', chrome_prefs) `

it is just for chromedriver.but no works with undetected-chromedriver.

pawanpaudel93 commented 3 years ago

@go8go It works bro. undetected-chromedriver is a wrapper over selenium with added functionalities for preventing bot detection and everything that's possible on selenium is possible on undetected-chromedriver. image

go8go commented 3 years ago

@go8go It works bro. undetected-chromedriver is a wrapper over selenium with added functionalities for preventing bot detection and everything that's possible on selenium is possible on undetected-chromedriver. image

but for v2 no works..can you make me some help?

below is my code: import undetected_chromedriver.v2 as options = uc.ChromeOptions() chrome_prefs = {} chrome_prefs["profile.default_content_settings"] = {"images": 2} chrome_prefs["profile.managed_default_content_settings"] = {"images": 2} options.add_experimental_option('prefs', chrome_prefs) driver = uc.Chrome(options=options) driver.get('https://www.dofus-touch.com/') # known url using cloudflare's "under attack mode" input()

error is : selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: cannot parse capability: goog:chromeOptions from invalid argument: unrecognized chrome option: prefs

Zorral commented 3 years ago

i got this same error, anyone has a good solution?

youpsla commented 3 years ago

Same error here with v2

liuqi0725 commented 3 years ago

same error . Is there a solution?

Bl3sk commented 3 years ago

Still nothing ?

Zorral commented 3 years ago

think someone already solved it else where, check around, remember that i saw it somewhere.

hafizhamid commented 3 years ago

@Zorral Can you please share a link if you could find out where you saw the solution.

Zorral commented 3 years ago

Mhm, I dont think I was able to find it but I was able to find this within my code: options.add_argument('--blink-settings=imagesEnabled=false')

Feel free to take credit if you were the one who discovered this! As I could not find who posted it first.

hafizhamid commented 3 years ago

Thanks @Zorral. This works.