kaliiiiiiiiii / Selenium-Driverless

undetected Selenium without usage of chromedriver
https://kaliiiiiiiiii.github.io/Selenium-Driverless/
Other
545 stars 66 forks source link

EXTENSION IN INCOGNITO METHOD FAILS #217

Closed nandish486 closed 5 months ago

nandish486 commented 5 months ago

image image

options = webdriver.ChromeOptions()
options.add_argument('--incognito')
# options.add_argument(f'--user-data-dir={userdata}')
options.add_extension(r'extension')
with webdriver.Chrome(options=options) as driver:
    driver.get('https://nopecha.com/demo/recaptcha', wait_load=True, timeout=10)
    driver.ensure_extensions_incognito_allowed()
    driver.maximize_window()

    driver.sleep(100)
    title = driver.title
    url = driver.current_url
    source = driver.page_source
kaliiiiiiiiii commented 5 months ago

enssure_extensions_allowed is only supported while there is a non-incognito window open

nandish486 commented 5 months ago

enssure_extensions_allowed is only supported while there is a non-incognito window open

how to use extension in incognito then?

kaliiiiiiiiii commented 5 months ago

use contexts There's an example in the readme You can also later close the main context, if you decide that you don't need it anymore

nandish486 commented 5 months ago

use contexts There's an example in the readme You can also later close the main context, if you decide that you don't need it anymore

i saw it but not satisfied, if we launch normal context is it just incognito version, one without user directory?

nandish486 commented 5 months ago

also if there is something like page.route() in playwright, for selenium driverless, cause selenium driverless is better

kaliiiiiiiiii commented 5 months ago

use contexts There's an example in the readme You can also later close the main context, if you decide that you don't need it anymore

i saw it but not satisfied, if we launch normal context is it just incognito version, one without user directory?

yeah, as I said

kaliiiiiiiiii commented 5 months ago

also if there is something like page.route() in playwright, for selenium driverless, cause selenium driverless is better

it's right there in the documentation & readme

nandish486 commented 5 months ago

it's right there in the documentation & readme

it not works with sync, is sync support not yet added?

kaliiiiiiiiii commented 5 months ago

it's right there in the documentation & readme

it not works with sync, is sync support not yet added?

yep