You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: playwright/async_api.py
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1295,7 +1295,7 @@ async def screenshot(
1295
1295
self,
1296
1296
timeout: int=None,
1297
1297
type: Literal["png", "jpeg"] =None,
1298
-
path: str=None,
1298
+
path: typing.Union[str, pathlib.Path]=None,
1299
1299
quality: int=None,
1300
1300
omitBackground: bool=None,
1301
1301
) ->bytes:
@@ -1309,7 +1309,7 @@ async def screenshot(
1309
1309
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
1310
1310
type : Optional[Literal['png', 'jpeg']]
1311
1311
Specify screenshot type, defaults to `png`.
1312
-
path : Optional[str]
1312
+
path : Union[str, pathlib.Path, NoneType]
1313
1313
The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.
1314
1314
quality : Optional[int]
1315
1315
The quality of the image, between 0-100. Not applicable to `png` images.
Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to current working directory.
2083
2090
content : Optional[str]
2084
2091
Raw CSS content to be injected into frame.
@@ -3966,7 +3973,7 @@ async def screenshot(
3966
3973
self,
3967
3974
timeout: int=None,
3968
3975
type: Literal["png", "jpeg"] =None,
3969
-
path: str=None,
3976
+
path: typing.Union[str, pathlib.Path]=None,
3970
3977
quality: int=None,
3971
3978
omitBackground: bool=None,
3972
3979
fullPage: bool=None,
@@ -3982,7 +3989,7 @@ async def screenshot(
3982
3989
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
3983
3990
type : Optional[Literal['png', 'jpeg']]
3984
3991
Specify screenshot type, defaults to `png`.
3985
-
path : Optional[str]
3992
+
path : Union[str, pathlib.Path, NoneType]
3986
3993
The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.
3987
3994
quality : Optional[int]
3988
3995
The quality of the image, between 0-100. Not applicable to `png` images.
Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for Chromium and Firefox.
5769
5776
executablePath : Optional[str]
5770
5777
Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
Copy file name to clipboardExpand all lines: playwright/sync_api.py
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1343,7 +1343,7 @@ def screenshot(
1343
1343
self,
1344
1344
timeout: int=None,
1345
1345
type: Literal["png", "jpeg"] =None,
1346
-
path: str=None,
1346
+
path: typing.Union[str, pathlib.Path]=None,
1347
1347
quality: int=None,
1348
1348
omitBackground: bool=None,
1349
1349
) ->bytes:
@@ -1357,7 +1357,7 @@ def screenshot(
1357
1357
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
1358
1358
type : Optional[Literal['png', 'jpeg']]
1359
1359
Specify screenshot type, defaults to `png`.
1360
-
path : Optional[str]
1360
+
path : Union[str, pathlib.Path, NoneType]
1361
1361
The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.
1362
1362
quality : Optional[int]
1363
1363
The quality of the image, between 0-100. Not applicable to `png` images.
Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to current working directory.
2161
2168
content : Optional[str]
2162
2169
Raw CSS content to be injected into frame.
@@ -4134,7 +4141,7 @@ def screenshot(
4134
4141
self,
4135
4142
timeout: int=None,
4136
4143
type: Literal["png", "jpeg"] =None,
4137
-
path: str=None,
4144
+
path: typing.Union[str, pathlib.Path]=None,
4138
4145
quality: int=None,
4139
4146
omitBackground: bool=None,
4140
4147
fullPage: bool=None,
@@ -4150,7 +4157,7 @@ def screenshot(
4150
4157
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
4151
4158
type : Optional[Literal['png', 'jpeg']]
4152
4159
Specify screenshot type, defaults to `png`.
4153
-
path : Optional[str]
4160
+
path : Union[str, pathlib.Path, NoneType]
4154
4161
The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.
4155
4162
quality : Optional[int]
4156
4163
The quality of the image, between 0-100. Not applicable to `png` images.
Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for Chromium and Firefox.
6005
6012
executablePath : Optional[str]
6006
6013
Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
0 commit comments