Skip to content

Commit d3b56b5

Browse files
committed
feat: Edge browser constructors to support optional connection port parameters
1 parent 1bda438 commit d3b56b5

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

pydoll/browser/chrome.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import platform
22
from typing import Optional
3-
from typing import Optional
43

54
from pydoll.browser.base import Browser
65
from pydoll.browser.managers import BrowserOptionsManager
@@ -16,14 +15,22 @@ class Chrome(Browser):
1615
"""
1716

1817
def __init__(
19-
self, options: Options | None = None, connection_port: int = 9222
18+
self,
19+
options: Optional[Options] = None,
20+
connection_port: Optional[int] = None,
2021
):
22+
"""
23+
Initializes the Chrome browser instance.
24+
25+
Args:
26+
options (Options | None): An instance of Options class to configure
27+
the browser. If None, default options will be used.
28+
connection_port (int): The port to connect to the browser.
29+
Defaults to 9222.
30+
"""
2131
if options is None:
2232
options = ChromeOptions()
23-
24-
# Initialize base class with options and port
2533
super().__init__(options, connection_port)
26-
2734

2835
@staticmethod
2936
def _get_default_binary_location():

pydoll/browser/edge.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
class Edge(Browser):
1111
def __init__(
12-
self, options: Options | None = None, connection_port: int = 9222
12+
self,
13+
options: Optional[Options] = None,
14+
connection_port: Optional[int] = None,
1315
):
1416
if options is None:
1517
options = EdgeOptions()

0 commit comments

Comments
 (0)