Exception Traceback (most recent call last)
\n in <cell line: 175>()
\n173 make_requests(path, s)
\n174
\n--> 175 main()
\n176
\n177
5 frames
\n in main()
\n169 path = get_path()
\n170 print('Started!')
\n--> 171 test(path)
\n172 s = requests.Session()
\n173 make_requests(path, s)
in test(path)
\n39 if detect_cf(sb):
\n40 print('cloudflare detected!')
\n---> 41 sb.uc_gui_handle_cf()
\n42
\n43 else:
/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in (*args, **kwargs)
\n4331 )
\n4332 driver.uc_gui_handle_cf = (
\n-> 4333 lambda *args, **kwargs: uc_gui_handle_cf(
\n4334 driver, *args, **kwargs
\n4335 )
/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in uc_gui_handle_cf(driver, frame)
\n906 if not _on_a_cf_turnstile_page(driver):
\n907 return
\n--> 908 install_pyautogui_if_missing(driver)
\n909 import pyautogui
\n910 pyautogui = get_configured_pyautogui(pyautogui)
/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in install_pyautogui_if_missing(driver)
\n565
\n566 def install_pyautogui_if_missing(driver):
\n--> 567 verify_pyautogui_has_a_headed_browser(driver)
\n568 pip_find_lock = fasteners.InterProcessLock(
\n569 constants.PipInstall.FINDLOCK
/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in verify_pyautogui_has_a_headed_browser(driver)
\n559 focus on the correct element when performing actions.\"\"\"
\n560 if hasattr(driver, \"_is_hidden\") and driver._is_hidden:
\n--> 561 raise Exception(
\n562 \"PyAutoGUI can't be used in headless mode!\"
\n563 )
Exception: PyAutoGUI can't be used in headless mode!
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"That's why it says: Exception: PyAutoGUI can't be used in headless mode!
Don't use UC Mode with Headless Mode.
","upvoteCount":1,"url":"https://github.com/seleniumbase/SeleniumBase/discussions/2932#discussioncomment-10064354"}}}-
|
def test(path): Here is the error I gotException Traceback (most recent call last) 5 frames in test(path) /usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in (*args, **kwargs) /usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in uc_gui_handle_cf(driver, frame) /usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in install_pyautogui_if_missing(driver) /usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py in verify_pyautogui_has_a_headed_browser(driver) Exception: PyAutoGUI can't be used in headless mode! |
Beta Was this translation helpful? Give feedback.
-
|
That's why it says: Don't use UC Mode with Headless Mode. |
Beta Was this translation helpful? Give feedback.
-
|
is there a way to bypass cloudflare with headless=True? |
Beta Was this translation helpful? Give feedback.
That's why it says:
Exception: PyAutoGUI can't be used in headless mode!Don't use UC Mode with Headless Mode.