kaliiiiiiiiii / Selenium-Driverless

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

HELP #203

Closed nandish486 closed 5 months ago

nandish486 commented 5 months ago

Is there anything equivalent to auto wait just like undetected playwright's page.wait_for_event('domcontentloaded'),

I tried

from selenium_driverless.sync import webdriver

options = webdriver.ChromeOptions()
with webdriver.Chrome(options=options) as driver:
    driver.get('http://nowsecure.nl#relax')
    driver.sleep(0.5)
    driver.wait_for_cdp("Page.domContentEventFired", timeout=15)

    title = driver.title
    url = driver.current_url
    source = driver.page_source
    print(title)

but it raises time out error, the site is loaded and it passed cf turnstile, but it won't close automatically, like it supposed to do without raising timeout errors.

kaliiiiiiiiii commented 5 months ago

@nandish486 Please don't open issues with poor description or without there being an actual bug

kaliiiiiiiiii commented 5 months ago

The feature you're looking for is generally available (async-only) using with

async for iframe in await driver.get_cdp_event_iter("Page.frameNavigated"):
   print(iframe)

I believe

nandish486 commented 5 months ago

The feature you're looking for is generally available (async-only) using with

async for iframe in await driver.get_cdp_event_iter("Page.frameNavigated"):
   print(iframe)

I believe

page not have any iframe, i want page to load wait , just like "domContentLoaded"

kaliiiiiiiiii commented 5 months ago

The feature you're looking for is generally available (async-only) using with

async for iframe in await driver.get_cdp_event_iter("Page.frameNavigated"):
   print(iframe)

I believe

page not have any iframe, i want page to load wait , just like "domContentLoaded"

well that's what driver.get( already does. Unless you specify wait_load=False

nandish486 commented 5 months ago

The feature you're looking for is generally available (async-only) using with

async for iframe in await driver.get_cdp_event_iter("Page.frameNavigated"):
   print(iframe)

I believe

page not have any iframe, i want page to load wait , just like "domContentLoaded"

well that's what driver.get( already does. Unless you specify wait_load=False

it just exits, not wait for complete page to load

kaliiiiiiiiii commented 5 months ago

it just exits, not wait for complete page to load

Well then there isn't a general way => wait for the relevant elements to appear