You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-11Lines changed: 36 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,43 +65,68 @@
65
65
66
66
--------
67
67
68
-
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py">raw_google.py</a>, which performs a Google search:</p>
68
+
<palign="left">📗 For performing a Google Search without hitting the "unusual traffic" page, you can use SeleniumBase UC Mode. Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py">SeleniumBase/examples/raw_google.py</a>, which exports the search results into different formats (PDF, HTML, PNG):</p>
<ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py"><imgsrc="https://seleniumbase.github.io/cdn/img/google_sb_result.png"alt="SeleniumBase on Google"title="SeleniumBase on Google"width="440" /></a>
84
89
85
90
--------
86
91
87
-
<palign="left">📗 Here's an example of bypassing Cloudflare's challenge page: <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_gitlab.py">SeleniumBase/examples/cdp_mode/raw_gitlab.py</a></p>
92
+
<palign="left">📗 Here's an example of bypassing Cloudflare's challenge page with UC Mode + CDP Mode: <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_gitlab.py">SeleniumBase/examples/cdp_mode/raw_gitlab.py</a></p>
<palign="left">📙 You can also use SeleniumBase's pure CDP Mode, which doesn't use chromedriver, Selenium, or a Python context manager at all: <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_cdp_gitlab.py">SeleniumBase/examples/cdp_mode/raw_cdp_gitlab.py</a></p>
112
+
113
+
```python
114
+
from seleniumbase import sb_cdp
115
+
116
+
url ="https://gitlab.com/users/sign_in"
117
+
sb = sb_cdp.Chrome(url)
118
+
sb.sleep(2.5)
119
+
sb.gui_click_captcha()
120
+
sb.highlight('h1:contains("GitLab.com")')
121
+
sb.highlight('button:contains("Sign in")')
122
+
sb.driver.stop()
123
+
```
124
+
125
+
> (Due to a change in Chrome 137 where the --load-extension switch was removed, one limitation with this format is that you can't load extensions directly. The other formats weren't affected by this change.)
126
+
102
127
--------
103
128
104
-
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py">test_get_swag.py</a>, which tests an e-commerce site:</p>
129
+
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py">SeleniumBase/examples/test_get_swag.py</a>, which tests an e-commerce site:</p>
105
130
106
131
```python
107
132
from seleniumbase import BaseCase
@@ -133,7 +158,7 @@ class MyTestClass(BaseCase):
133
158
134
159
--------
135
160
136
-
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py"target="_blank">test_coffee_cart.py</a>, which verifies an e-commerce site:</p>
161
+
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py"target="_blank">SeleniumBase/examples/test_coffee_cart.py</a>, which verifies an e-commerce site:</p>
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"target="_blank">test_demo_site.py</a>, which covers several actions:</p>
175
+
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"target="_blank">SeleniumBase/examples/test_demo_site.py</a>, which covers several actions:</p>
0 commit comments