@@ -170,7 +170,8 @@ def write_url_doc_to_file(doc, file_content, out_dir, make_name_unique=False):
170
170
171
171
172
172
@asynccontextmanager
173
- async def pw_page (browser , intercept_routes = False , stealth_config = None ):
173
+ async def pw_page (browser , intercept_routes = False , stealth_config = None ,
174
+ ignore_https_errors = False ):
174
175
"""Create new page from playwright browser context
175
176
176
177
Parameters
@@ -184,6 +185,13 @@ async def pw_page(browser, intercept_routes=False, stealth_config=None):
184
185
Optional playwright stealth configuration object.
185
186
By default, ``None``, which uses all the default stealth
186
187
options.
188
+ ignore_https_errors : bool, default=False
189
+ Option to ignore https errors (i.e. SSL cert errors). This is
190
+ not generally safe to do - you are susceptible to MITM attacks.
191
+ However, if you are doing a simple scrape without providing
192
+ any sensitive information (which you probably shouldn't be doing
193
+ programmatically anyways), then it's probably ok to ignore these
194
+ errors. By default, ``False``.
187
195
188
196
Yields
189
197
------
@@ -202,6 +210,7 @@ async def pw_page(browser, intercept_routes=False, stealth_config=None):
202
210
extra_http_headers = DEFAULT_HEADERS ,
203
211
user_agent = ua ,
204
212
viewport = {"width" : randint (800 , 1400 ), "height" : randint (800 , 1400 )},
213
+ ignore_https_errors = ignore_https_errors ,
205
214
)
206
215
207
216
try :
0 commit comments