-
Hello, from seleniumbase import Driver
browser = Driver(uc=True,user_data_dir = profileDir, proxy=PROXY_USER+":"+PROXY_PASS+"@"+PROXY_HOST+":"+PROXY_PORT)
time.sleep(2)
Driver.open(someURL)
time.sleep(0.5)
#Here is where the "problematic" waiting time happens before the click
elementToClick = browser.find_elements(By.XPATH, "//*[contains(text(),'something')]")
if elementToClick != []:
elementToClick[0].click() Keep in mind this is just a quick example, I usually use WebDriverWait(browser, 8).until(EC.visibility_of_element_located((By.CSS_SELECTOR, 'something'))) to speed things up. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
One of the things that SeleniumBase does to avoid detection is to:
(It's one of the things listed in #2000) It's only done when a To perform the original To summarize, use |
Beta Was this translation helpful? Give feedback.
One of the things that SeleniumBase does to avoid detection is to:
(It's one of the things listed in #2000)
It's only done when a
requests.get()
call returns a403
, or similar. If that happens, chromedriver disconnects from the browser as the web page gets loaded, and then reconnects as quickly as possible so that selenium can resume performing actions. The defaultdriver.get()
method is modified with this change.To perform the original
driver.get()
call (which doesn't have this extra wait), useself.driver.default_get()
instead.To summarize, use
self.driver.default_get(URL)
when i…