Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detailed Explanation and Usage of Website Connection Options and Parameters #2896

Closed
PankajSavaliya opened this issue Jul 2, 2024 · 4 comments
Labels
question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@PankajSavaliya
Copy link

PankajSavaliya commented Jul 2, 2024

Can you please explain these options in detail and when they should be used? There are many options available to load a website, connect, and disconnect, but why are these options available? I would also like to understand reconnect_time, timeout, and each feature so I can use them precisely.

I'm using this SB with multi-threading as per your document with UC so please give me the proper document for that way.

driver = Driver(uc=True, agent=generate_random_mobile_user_agent(False), )

  1. driver.uc_open(url)

  2. driver.uc_open_with_tab(url)

  3. driver.uc_open_with_reconnect(url, reconnect_time=None)

  4. driver.uc_open_with_disconnect(url, timeout=None)

  5. driver.reconnect(timeout)

  6. driver.disconnect()

  7. driver.connect()

@mdmintz mdmintz added question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Jul 2, 2024
@mdmintz
Copy link
Member

mdmintz commented Jul 2, 2024

The UC Mode docs are here: SeleniumBase/help_docs/uc_mode.md

And those methods are described in detail in the UC Mode video tutorials:


(Watch the 1st UC Mode tutorial on YouTube! ▶️)


(Watch the 2nd UC Mode tutorial on YouTube! ▶️)


Disconnecting the driver from Chrome makes Selenium less detectable during that time.

# "driver"-specific methods added (or modified) by SeleniumBase for UC Mode:

driver.get(url)  # If UC Mode and site detects bots, then uc_open_with_tab(url)
driver.uc_open(url)  # (Open in same tab with default reconnect_time)
driver.uc_open_with_tab(url)  # (New tab with default reconnect_time)
driver.uc_open_with_reconnect(url, reconnect_time=None)  # (New tab)
driver.uc_open_with_disconnect(url, timeout=None)  # New tab + sleep()
driver.reconnect(timeout)  # disconnect() + sleep(timeout) + connect()
driver.disconnect()  # Stops the webdriver service to prevent detection
driver.connect()  # Starts the webdriver service to allow actions again
driver.uc_click(selector)  # A stealthy click for evading bot-detection
driver.uc_gui_press_key(key)  # Use PyAutoGUI to press the keyboard key
driver.uc_gui_press_keys(keys)  # Use PyAutoGUI to press a list of keys
driver.uc_gui_write(text)  # Similar to uc_gui_press_keys(), but faster
driver.uc_gui_handle_cf(frame="iframe")  # PyAutoGUI click CF Turnstile

@mdmintz mdmintz closed this as completed Jul 2, 2024
@PankajSavaliya
Copy link
Author

@mdmintz in which these methods should be used? (Connect, Reconnect, and Disconnect) and when for undetection?

@PankajSavaliya
Copy link
Author

@mdmintz in which these methods should be used? (Connect, Reconnect, and Disconnect) and when for undetection?

@mdmintz can you please explain when these methods should be called and which case? like click, and scroll.

@mdmintz
Copy link
Member

mdmintz commented Jul 8, 2024

@PankajSavaliya You've been spamming the SeleniumBase GitHub repo with lots of duplicate and/or off-topic comments in a short period of time. That's definitely unacceptable behavior, and grounds for getting blocked.

Screenshot 2024-07-08 at 9 56 57 AM

That's in violation of SeleniumBase Terms of Service policies, eg: #2249. You'll be blocked for your actions.

GitHub repo maintainers are not your personal task-rabbits. Maintainers lead busy lives, and we don't always have time to respond to messages in a timely fashion. People should be respectful of GitHub repo maintainers. Those who cannot be respectful have no place here.

@seleniumbase seleniumbase locked as too heated and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

No branches or pull requests

2 participants