-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathhacking_with_cdp.py
146 lines (144 loc) · 5.34 KB
/
hacking_with_cdp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# https://www.youtube.com/watch?v=vt2zsdiNh3U
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)
class UCPresentationClass(BaseCase):
def test_hacking_with_cdp(self):
self.open("data:,")
self.set_window_position(4, 40)
self._output_file_saves = False
self.create_presentation(theme="serif", transition="none")
self.add_slide("<h2>Press SPACE to begin!</h2>\n")
self.add_slide(
"<p><h3><mk-0>Coming up on the Hacker Show...</mk-0></h3></p>\n"
"<hr /><ul>\n"
'<img src="https://seleniumbase.io/other/hackers_at_comp.jpg"'
' width="100%">'
"</ul>",
)
self.add_slide(
"<p><b>Coming up on the Hacker Show...</b></p>\n"
"<hr /><br /><ul>\n"
"<li><mk-0>Intercepting requests/responses/XHR with CDP."
"</mk-0></li><br />\n"
"<br /><br />\n"
"<br /><br />\n"
"<br /><br />\n"
"<br /><br />\n"
"</ul>",
)
self.add_slide(
"<p><b>Coming up on the Hacker Show...</b></p>\n"
"<hr /><br /><ul>\n"
"<li>Intercepting requests/responses/XHR with CDP."
"</li><br />\n"
"<li><mk-0>Modifying requests: CDP.Fetch.continueRequest."
"</mk-0></li><br />\n"
"<br /><br />\n"
"<br /><br />\n"
"<br /><br />\n"
"</ul>",
)
self.add_slide(
"<p><b>Coming up on the Hacker Show...</b></p>\n"
"<hr /><br /><ul>\n"
"<li>Intercepting requests/responses/XHR with CDP."
"</li><br />\n"
"<li>Modifying requests: CDP.Fetch.continueRequest."
"</li><br />\n"
"<li><mk-0>Controlling browsers via remote-debugging-port"
"</mk-0></li><br />\n"
"<br /><br />\n"
"<br /><br />\n"
"</ul>",
)
self.add_slide(
"<p><b>Coming up on the Hacker Show...</b></p>\n"
"<hr /><br /><ul>\n"
"<li>Intercepting requests/responses/XHR with CDP."
"</li><br />\n"
"<li>Modifying requests: CDP.Fetch.continueRequest."
"</li><br />\n"
"<li>Controlling browsers via remote-debugging-port"
"</li><br />\n"
"<li><mk-0>Bypassing CAPTCHAs & anti-bot defenses."
"</mk-0></li><br />\n"
"<br /><br />\n"
"</ul>",
)
self.add_slide(
"<p><b>Coming up on the Hacker Show...</b></p>\n"
"<hr /><br /><ul>\n"
"<li>Intercepting requests/responses/XHR with CDP."
"</li><br />\n"
"<li>Modifying requests: CDP.Fetch.continueRequest."
"</li><br />\n"
"<li>Controlling browsers via remote-debugging-port"
"</li><br />\n"
"<li>Bypassing CAPTCHAs & anti-bot defenses."
"</li><br />\n"
"<li><mk-0>And live demos of all the above... with Python!"
"</mk-0></li><br />\n"
"</ul>",
)
self.add_slide(
"<h2>Get ready for some<br />serious hacking!</h2>"
)
self.add_slide(
'<img src="https://seleniumbase.io/other/hacking_with_cdp.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/cdp.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/ms_edp.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/vid4_on_yt.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/cdp_in_sb.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/hacker_news.png"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/sb_star_history_3.png"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/top_trending_month.png"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/cdp_con_req.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/mycdp_con_req.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/sb_con_req.jpg"'
' width="100%">'
)
self.add_slide(
'<img src="https://seleniumbase.io/other/xhr_info.jpg"'
' width="100%">'
)
self.add_slide(
'<h3>The <code>remote-debugging-port</code></h3>'
'<img src="https://seleniumbase.io/other/rd_port.jpg"'
' width="100%">'
)
self.add_slide(
"<h3>Let's get to the fun part...</h3>"
'<img src="https://seleniumbase.io/other/hackers_at_comp.jpg"'
' width="80%">'
)
self.begin_presentation(filename="uc_presentation.html")