File tree Expand file tree Collapse file tree 2 files changed +36
-19
lines changed Expand file tree Collapse file tree 2 files changed +36
-19
lines changed Original file line number Diff line number Diff line change 4
4
5
5
The SeleniumBase Driver as a context manager:
6
6
Usage --> ``with DriverContext() as driver:``
7
- Usage example -->
8
- from seleniumbase import DriverContext
9
- with DriverContext() as driver:
10
- driver.get("https://google.com/ncr")
11
- # The browser exits automatically after the "with" block ends.
7
+
8
+ Example -->
9
+
10
+ ```
11
+ from seleniumbase import DriverContext
12
+
13
+ with DriverContext() as driver:
14
+ driver.get("https://google.com/ncr")
15
+ ```
16
+
17
+ # (The browser exits automatically after the "with" block ends.)
12
18
13
19
###########################################################################
14
20
# Above: The driver as a context manager. (Used with a "with" statement.) #
18
24
19
25
The SeleniumBase Driver as a returnable object:
20
26
Usage --> ``driver = Driver()``
21
- Usage example -->
22
- from seleniumbase import Driver
23
- driver = Driver()
24
- driver.get("https://google.com/ncr")
27
+
28
+ Example -->
29
+
30
+ ```
31
+ from seleniumbase import Driver
32
+
33
+ driver = Driver()
34
+ driver.get("https://google.com/ncr")
35
+ ```
25
36
26
37
###########################################################################
27
38
"""
Original file line number Diff line number Diff line change 4
4
5
5
The SeleniumBase SB Context Manager:
6
6
Usage --> ``with SB() as sb:``
7
- Usage example -->
8
- from seleniumbase import SB
9
- with SB() as sb: # Many args! Eg. SB(browser="edge")
10
- sb.open("https://google.com/ncr")
11
- sb.type('[name="q"]', "SeleniumBase on GitHub\n ")
12
- sb.click('a[href*="github.com/seleniumbase"]')
13
- sb.highlight("div.Layout-main")
14
- sb.highlight("div.Layout-sidebar")
15
- sb.sleep(0.5)
16
- # The browser exits automatically after the "with" block ends.
7
+
8
+ Example -->
9
+
10
+ ```
11
+ from seleniumbase import SB
12
+
13
+ with SB() as sb: # Many args! Eg. SB(browser="edge")
14
+ sb.open("https://google.com/ncr")
15
+ sb.type('[name="q"]', "SeleniumBase on GitHub\n ")
16
+ sb.click('a[href*="github.com/seleniumbase"]')
17
+ sb.highlight("div.Layout-main")
18
+ sb.highlight("div.Layout-sidebar")
19
+ sb.sleep(0.5)
20
+ ```
21
+
22
+ # (The browser exits automatically after the "with" block ends.)
17
23
18
24
#########################################
19
25
"""
You can’t perform that action at this time.
0 commit comments