Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CPD Mode Best Practices #3957

Answered by mdmintz
joecaraccio asked this question in Q&A
Discussion options

Hi There!

Have just starting playing around with SeleniumBase in general.. particularly UC mode and CPD mode and have been loving it. Hopefully this discussion is okay.. it seems appropriate for the Q&A section but I could very well be wrong!

My requirements for a test project I am starting to work on is to absolutely not be detected. I guess my questioning is:

  1. Is there a recommended best practice for CPD Mode? It seems like certain functions will kick you into other modes. My use case is extremely simple (click buttons, inspect page source, find buttons, click them)
  2. Do I have to accept that CPD Mode will still be detectable in some cases? The more I've read online, it reminds me of AdBlock tools, where many smart people on both sides are working to be undetected and detected. I was just recently reading some articles about how signatures left in data showcased the use of CPD mode... also subsequently a recently posted article explaining it no longer is detectable via that property
  3. When using CPD Mode.. do you ever run it against a gauntlet of pre-check tests before proceeding?
  4. Are there any hooks/maybe recommended approaches of using SelenuimBase with more pywinauto based approaches instead? I have to imagine for simplier cases ultimately gui automation is the hardest to pull off.. but also hardest to solve. From my understanding for some cases selenuim uses this? (Could be wrong)

Thanks for any help! Feeling a bit overwhelmed!

Joe

You must be logged in to vote

The best way to learn best practices is to learn from the existing CDP Mode examples: SeleniumBase/examples/cdp_mode. Over 60 different examples of bypassing bot-detection on various websites. There are use cases from simple to advanced, bypassing the major anti-bot defense systems such as Cloudflare, Human/PerimeterX, F5/Shape, Incapsula, Kasada, DataDome, and Akamai.

There will always be some limitations. For example, running from a non-residential IP address (without a non-residential proxy) can make you detectable if the anti-bot system is looking for that. Not sure about what articles you read about CDP Mode, but the examples are working both locally, and on an Ubuntu Linux GitHub Ac...

Replies: 1 comment 3 replies

Comment options

The best way to learn best practices is to learn from the existing CDP Mode examples: SeleniumBase/examples/cdp_mode. Over 60 different examples of bypassing bot-detection on various websites. There are use cases from simple to advanced, bypassing the major anti-bot defense systems such as Cloudflare, Human/PerimeterX, F5/Shape, Incapsula, Kasada, DataDome, and Akamai.

There will always be some limitations. For example, running from a non-residential IP address (without a non-residential proxy) can make you detectable if the anti-bot system is looking for that. Not sure about what articles you read about CDP Mode, but the examples are working both locally, and on an Ubuntu Linux GitHub Actions server, eg: https://github.com/mdmintz/undetected-testing/actions/runs/17436465485/job/49507538775.

Many of your questions can also be answered in the existing YouTube tutorial series for SeleniumBase:

You must be logged in to vote
3 replies
Comment options

Really appreciate the reply! Just going to run locally at my house on windows so have to imagine its one of the easier environments.

Watching one of the videos now, didn't realize the anti bot detection service in discord was out there.. I'll have to give that a try! That is so cool.

IN general the documentation on this software is incredible.

Apologies if I missed it, but in the spirit of automation, have you ever automated anti bot checks? I guess it would give me peace of mind to know some new patch didn't get rolled out and break the capability.

Another question.. any reason to prefer sb.cdp.gui_click_element over sb.cdp.click? I know the former uses PyAutoGUI, wasn't sure if it added any additional intractability benefits automating at OS level

Comment options

Thank you. I put in a lot of work into it.

Anti-bot / stealth testing is handled in https://github.com/mdmintz/undetected-testing/actions.

Most of the time, you won't need sb.cdp.gui_click_element(selector), unless it's some situation where you have to click on something that's hidden behind Shadow-root, or another situation where the website won't accept the click unless it detects that the mouse is hovering over the element that you want to click. With gui_click_element(), there's the mouse-move from PyAutoGUI, which gives you that mouse hover before the click because it moves the mouse and then clicks with it.

Comment options

Thank you! Also I want to clarify from my awkward wording.. I meant to say "the documentation on this software is incredible".. think I intertwined two thoughts when I said "in general". This is incredible stuff.

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /