|
| 1 | +from seleniumbase import BaseCase |
| 2 | +BaseCase.main(__name__, __file__) |
| 3 | + |
| 4 | + |
| 5 | +class UCPresentationClass(BaseCase): |
| 6 | + def test_hacking_with_cdp(self): |
| 7 | + self.open("data:,") |
| 8 | + self.set_window_position(4, 40) |
| 9 | + self._output_file_saves = False |
| 10 | + self.create_presentation(theme="serif", transition="none") |
| 11 | + self.add_slide("<h2>Press SPACE to begin!</h2>\n") |
| 12 | + self.add_slide( |
| 13 | + "<p><b><mk-0>Coming up... on the Hacker Show:</mk-0></b></p>\n" |
| 14 | + "<hr /><ul>\n" |
| 15 | + '<img src="https://seleniumbase.io/other/robot_ai.jpg"' |
| 16 | + ' width="92%"></ul>\n' |
| 17 | + "<br /><br />\n" |
| 18 | + "<br /><br />\n", |
| 19 | + ) |
| 20 | + self.add_slide( |
| 21 | + "<p><b>Coming up... on the Hacker Show:</b></p>\n" |
| 22 | + "<hr /><br /><ul>\n" |
| 23 | + "<li><mk-0>Unlimited free web-scraping w/ GitHub Actions \n" |
| 24 | + "</mk-0></li>\n" |
| 25 | + "</ul>" |
| 26 | + '<img src="https://seleniumbase.io/other/gha_scraping.jpg"' |
| 27 | + ' width="82%">', |
| 28 | + ) |
| 29 | + self.add_slide( |
| 30 | + "<p><b>Coming up... on the Hacker Show:</b></p>\n" |
| 31 | + "<hr /><br /><ul>\n" |
| 32 | + "<li>Unlimited free web-scraping w/ GitHub Actions " |
| 33 | + "</li><br />\n" |
| 34 | + "<li><mk-0>Using GitHub Secrets to hide within open-source" |
| 35 | + "</mk-0></li></ul>\n" |
| 36 | + '<img src="https://seleniumbase.io/other/gh_secret.png"' |
| 37 | + ' width="80%">\n' |
| 38 | + "<br /><br />\n" |
| 39 | + "<br /><br />\n", |
| 40 | + ) |
| 41 | + self.add_slide( |
| 42 | + "<p><b>Coming up... on the Hacker Show:</b></p>\n" |
| 43 | + "<hr /><br /><ul>\n" |
| 44 | + "<li>Unlimited free web-scraping w/ GitHub Actions " |
| 45 | + "</li><br />\n" |
| 46 | + "<li>Using GitHub Secrets to hide within open-source" |
| 47 | + "</li><br />\n" |
| 48 | + "<li><mk-0>Launching your own, free, local proxy server" |
| 49 | + "</mk-0></li></ul>\n" |
| 50 | + '<img src="https://seleniumbase.io/other/sbase_proxy.png"' |
| 51 | + ' width="80%">' |
| 52 | + "<br /><br />\n" |
| 53 | + ) |
| 54 | + self.add_slide( |
| 55 | + "<p><b>Coming up... on the Hacker Show:</b></p>\n" |
| 56 | + "<hr /><br /><ul>\n" |
| 57 | + "<li>Unlimited free web-scraping w/ GitHub Actions " |
| 58 | + "</li><br />\n" |
| 59 | + "<li>Using GitHub Secrets to hide within open-source" |
| 60 | + "</li><br />\n" |
| 61 | + "<li>Launching your own, free, local proxy server" |
| 62 | + "</li><br />\n" |
| 63 | + '<li><mk-0>Using "iptables" to make a proxy server public' |
| 64 | + "</mk-0></li></ul>\n" |
| 65 | + '<img src="https://seleniumbase.io/other/tiny_iptables.png"' |
| 66 | + ' width="80%">' |
| 67 | + "<br /><br />\n", |
| 68 | + ) |
| 69 | + self.add_slide( |
| 70 | + "<p><b>Coming up... on the Hacker Show:</b></p>\n" |
| 71 | + "<hr /><br /><ul>\n" |
| 72 | + "<li>Unlimited free web-scraping w/ GitHub Actions " |
| 73 | + "</li><br />\n" |
| 74 | + "<li>Using GitHub Secrets to hide within open-source" |
| 75 | + "</li><br />\n" |
| 76 | + "<li>Launching your own, free, local proxy server" |
| 77 | + "</li><br />\n" |
| 78 | + '<li>Using "iptables" to make a proxy server public' |
| 79 | + "</li><br />\n" |
| 80 | + "<li><mk-0>And multiple live demos after the previews" |
| 81 | + "</mk-0></li><br />\n" |
| 82 | + "</ul>", |
| 83 | + ) |
| 84 | + self.add_slide( |
| 85 | + "<p><b>Get ready for some serious hacking!</b></p>" |
| 86 | + '<img src="https://seleniumbase.io/other/hackers_at_comp.jpg"' |
| 87 | + ' width="80%">' |
| 88 | + ) |
| 89 | + self.add_slide( |
| 90 | + '<img src="https://seleniumbase.io/other/web_scraping.jpg"' |
| 91 | + ' width="100%">' |
| 92 | + ) |
| 93 | + self.add_slide( |
| 94 | + "<p><mk-0>And YES, that means bypassing bot-detection!</mk-0>" |
| 95 | + '<img src="https://seleniumbase.io/other/bypassable_anti_bots.jpg"' |
| 96 | + ' width="90%">' |
| 97 | + ) |
| 98 | + self.add_slide( |
| 99 | + "<p><b>But first, a little bit about me...</b></p>" |
| 100 | + '<img src="https://seleniumbase.io/other/mintz_present.jpg"' |
| 101 | + ' width="80%">' |
| 102 | + ) |
| 103 | + self.add_slide( |
| 104 | + "<p><b>About me: (Michael Mintz)</b></p>\n" |
| 105 | + "<ul>\n" |
| 106 | + "<li>I created the <b>SeleniumBase</b> framework." |
| 107 | + "</li>\n" |
| 108 | + "<li>And I lead the Automation Team at <b>iboss</b>." |
| 109 | + "</li>\n" |
| 110 | + "</ul>" |
| 111 | + '<img src="https://seleniumbase.io/other/iboss_me_2.jpg"' |
| 112 | + ' width="60%">' |
| 113 | + ) |
| 114 | + self.add_slide( |
| 115 | + "<p><b>Fun Fact</b></p><hr />\n" |
| 116 | + "<p>I once showed SeleniumBase to Sam Altman at MIT.<br />" |
| 117 | + "(Sam Altman cofounded OpenAI with Elon Musk.)" |
| 118 | + '<img src="https://seleniumbase.io/other/with_altman.jpg"' |
| 119 | + ' width="90%">' |
| 120 | + ) |
| 121 | + self.add_slide( |
| 122 | + "<p><b>Recently, SeleniumBase was trending on GitHub:" |
| 123 | + "</b></p>\n" |
| 124 | + '<img src="https://seleniumbase.io/other/trending_2025.png"' |
| 125 | + ' width="100%">' |
| 126 | + ) |
| 127 | + self.add_slide( |
| 128 | + "<p>The recent popularity can be attributed to <b>CDP Mode</b>," |
| 129 | + "<br />which provides advanced stealth during automation.</p>" |
| 130 | + '<img src="https://seleniumbase.io/other/cdp_in_sb.jpg"' |
| 131 | + ' width="100%">' |
| 132 | + ) |
| 133 | + self.add_slide( |
| 134 | + "<p>That stealth is enough to bypass bot-detection<br />" |
| 135 | + "while web-scraping from <b>GitHub Actions</b>:</p>" |
| 136 | + '<img src="https://seleniumbase.io/other/gha_scraping.jpg"' |
| 137 | + ' width="90%">' |
| 138 | + ) |
| 139 | + self.add_slide( |
| 140 | + "<p><b>GitHub Actions</b> is free for public repositories:</p>" |
| 141 | + '<img src="https://seleniumbase.io/other/gha_info.png"' |
| 142 | + ' width="90%">' |
| 143 | + ) |
| 144 | + self.add_slide( |
| 145 | + '<img src="https://seleniumbase.io/other/gha_is_free.png"' |
| 146 | + ' width="100%">' |
| 147 | + ) |
| 148 | + self.add_slide( |
| 149 | + "<p>To hide sensitive information while using" |
| 150 | + "<br />GitHub Actions for open-source projects," |
| 151 | + "<br />there's a feature called: <b>GitHub Secrets</b>.</p>" |
| 152 | + "<br />" |
| 153 | + "<p>That removes the limitation" |
| 154 | + r"<br />of being 100% open-source," |
| 155 | + r"<br />while still being 100% free.</p>" |
| 156 | + ) |
| 157 | + self.add_slide( |
| 158 | + '<img src="https://seleniumbase.io/other/using_secrets_in_gha.png"' |
| 159 | + ' width="100%">' |
| 160 | + ) |
| 161 | + self.add_slide( |
| 162 | + '<img ' |
| 163 | + 'src="https://seleniumbase.io/other/limits_for_gh_secrets.png"' |
| 164 | + ' width="100%">' |
| 165 | + ) |
| 166 | + self.add_slide( |
| 167 | + '<img src="https://seleniumbase.io/other/creating_gh_secrets.jpg"' |
| 168 | + ' width="80%">' |
| 169 | + ) |
| 170 | + self.add_slide( |
| 171 | + '<img src="https://seleniumbase.io/other/gh_secrets_in_wf.png"' |
| 172 | + ' width="88%">' |
| 173 | + ) |
| 174 | + self.add_slide( |
| 175 | + '<img ' |
| 176 | + 'src="https://seleniumbase.io/other/using_gh_secrets_in_py.png"' |
| 177 | + ' width="88%">' |
| 178 | + ) |
| 179 | + self.add_slide( |
| 180 | + "<h3>And that's the secret<br />to <b>GitHub Secrets!</b></h3>" |
| 181 | + ) |
| 182 | + self.add_slide( |
| 183 | + "<h3>Up next:</h3>" |
| 184 | + "<br />" |
| 185 | + "<h2>Instant proxy server</h2>" |
| 186 | + "<br />" |
| 187 | + "<p>(Faster to launch than making Instant Coffee!)" |
| 188 | + ) |
| 189 | + self.add_slide( |
| 190 | + '<h2><code>"sbase proxy"</code></h2>' |
| 191 | + "<br />" |
| 192 | + "<h3>(That's it!)</h3>" |
| 193 | + "<br />" |
| 194 | + '<img src="https://seleniumbase.io/other/sbase_proxy.png"' |
| 195 | + ' width="100%">' |
| 196 | + ) |
| 197 | + self.add_slide( |
| 198 | + '<p>More configuration options for "<b>sbase proxy</b>":</p>' |
| 199 | + '<img src="https://seleniumbase.io/other/instant_proxy.png"' |
| 200 | + ' width="80%">' |
| 201 | + ) |
| 202 | + self.add_slide( |
| 203 | + "<p>The proxy server code comes from <b>proxy.py</b>:</p>" |
| 204 | + '<img src="https://seleniumbase.io/other/proxy_dot_py.png"' |
| 205 | + ' width="80%">' |
| 206 | + ) |
| 207 | + self.add_slide( |
| 208 | + "<p><mk-0>" |
| 209 | + "Here's how to configure a proxy with <b>SeleniumBase</b>:</mk-0>" |
| 210 | + "</p><hr /><br /><ul>\n" |
| 211 | + '<li><mk-1>Proxy Mode via <code><b>pytest</b></code>:</mk-1>' |
| 212 | + '<br /><code>pytest --proxy="host:port"</code>' |
| 213 | + '<br /><code>pytest --proxy="user:pass@host:port"</code>' |
| 214 | + '</li><br />\n' |
| 215 | + '<li><mk-2>Proxy Mode via <code><b>SB()</b></code> manager:</mk-2>' |
| 216 | + '<br /><code>SB(proxy="host:port")</code>' |
| 217 | + '<br /><code>SB(proxy="user:pass@host:port")</code>' |
| 218 | + '</li>\n' |
| 219 | + ) |
| 220 | + self.add_slide( |
| 221 | + "<h3>That's the secret to<br />instant proxy servers!</h3>" |
| 222 | + "<br /><p>(And how to use them with SeleniumBase)</p>" |
| 223 | + ) |
| 224 | + self.add_slide( |
| 225 | + "<h3>How about opening up a" |
| 226 | + "<br />proxy server to the world?</h3><br />" |
| 227 | + ) |
| 228 | + self.add_slide( |
| 229 | + "<h2>For that, there's <b>iptables</b></h2><br />" |
| 230 | + '<img src="https://seleniumbase.io/other/iptables_info.png"' |
| 231 | + ' width="100%">' |
| 232 | + ) |
| 233 | + self.add_slide( |
| 234 | + '<img src="https://seleniumbase.io/other/iptables_guide.png"' |
| 235 | + ' width="100%">' |
| 236 | + ) |
| 237 | + self.add_slide( |
| 238 | + "<h3>And that's the secret to<br />making a server public!</h3>" |
| 239 | + '<img src="https://seleniumbase.io/other/super_server.jpg"' |
| 240 | + ' width="66%">' |
| 241 | + ) |
| 242 | + self.add_slide( |
| 243 | + "<h3>Let's move on to<br />some live demos</h3>" |
| 244 | + '<img src="https://seleniumbase.io/other/hackers_at_comp.jpg"' |
| 245 | + ' width="70%">' |
| 246 | + ) |
| 247 | + self.begin_presentation(filename="uc_presentation.html") |
0 commit comments