Skip to content

Commit fabc26b

Browse files
committed
Fix selenium internal API changes
1 parent d0932c9 commit fabc26b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pyhtml2pdf/converter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ def __send_devtools(driver, cmd, params=None):
7676
if params is None:
7777
params = {}
7878
resource = "/session/%s/chromium/send_command_and_get_result" % driver.session_id
79-
url = driver.command_executor._url + resource
79+
if hasattr(driver.command_executor, '_client_config'):
80+
remote_url = driver.command_executor._client_config.remote_server_addr
81+
else:
82+
# Old internal API
83+
remote_url = driver.command_executor._url
84+
url = remote_url + resource
8085
body = json.dumps({"cmd": cmd, "params": params})
8186
response = driver.command_executor._request("POST", url, body)
8287

0 commit comments

Comments
 (0)