Repository navigation
sb-stealth-wrapper: a small UC Mode wrapper for testing your own apps behind bot protection #4530
godhiraj-code
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I wanted to share a small project I've been working on: sb-stealth-wrapper. All of the real work here is done by SeleniumBase and UC Mode. This is just a thin wrapper built on top of them, so full credit goes to SeleniumBase and the people who maintain it.
I kept writing the same setup and retry code for test suites that run against apps sitting behind bot protection, so I pulled it into one package.
What it adds on top of UC Mode
StealthBotclass (used as a context manager) withsafe_get,smart_click,smart_typeandsave_screenshot.ChallengeNotSolvedError. If you setsuccess_criteriaand that text never shows up, it raisesSuccessCriteriaNotMetError. The idea is that tests fail loudly instead of quietly moving on.smart_clickfalls back to a normal SeleniumBase click and then a JS click, and raises an error if none of them work.Quick example
Please note
This is meant for testing your own apps, or apps you are authorized to test. It does not promise to be undetectable, and it won't get past every challenge. Results depend on the site, IP, browser version and so on. It also doesn't bypass access controls, rate limits or a site's terms.
Install
Repo: https://github.com/godhiraj-code/stealthautomation
Thank you @mdmintz for building and maintaining SeleniumBase. UC Mode made this possible. Any feedback is welcome, especially if I'm using something the wrong way or if there's a better built-in approach I should switch to.
Thanks!
All reactions