Skip to content

Commit 4e48695

Browse files
committed
FIX: Ajust in import edge options and start driver
1 parent 032be50 commit 4e48695

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

botcity/web/bot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ def check_driver():
254254
self.capabilities = cap
255255
driver_path = self.driver_path or check_driver()
256256
self.driver_path = driver_path
257-
258-
self._driver = driver_class(options=opt, desired_capabilities=cap, executable_path=driver_path)
257+
if BROWSER_CONFIGS.get(self.browser).get("driver") == "msedgedriver":
258+
self._driver = driver_class(options=opt, capabilities=cap, executable_path=driver_path)
259+
else:
260+
self._driver = driver_class(options=opt, desired_capabilities=cap, executable_path=driver_path)
259261
self.set_screen_resolution()
260262

261263
def stop_browser(self):

botcity/web/browsers/edge.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
import time
66
from typing import Dict
77

8-
from msedge.selenium_tools import Edge, EdgeOptions # noqa: F401, F403
8+
# from msedge.selenium_tools import Edge, EdgeOptions # noqa: F401, F403
99
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
10+
from selenium.webdriver.edge.options import Options
11+
from selenium.webdriver import Edge # noqa: F401, F403
1012

1113
from ..util import cleanup_temp_dir
1214

1315

1416
def default_options(headless=False, download_folder_path=None, user_data_dir=None,
15-
page_load_strategy="normal") -> EdgeOptions:
17+
page_load_strategy="normal") -> Options:
1618
"""Retrieve the default options for this browser curated by BotCity.
1719
1820
Args:
@@ -26,7 +28,7 @@ def default_options(headless=False, download_folder_path=None, user_data_dir=Non
2628
Returns:
2729
EdgeOptions: The Edge options.
2830
"""
29-
edge_options = EdgeOptions()
31+
edge_options = Options()
3032
try:
3133
page_load_strategy = page_load_strategy.value
3234
except AttributeError:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
botcity-framework-base>=0.2.2
22
beautifulsoup4
3-
msedge-selenium-tools==3.141.4
43
numpy
54
opencv-python
65
pillow

0 commit comments

Comments
 (0)