Playwright - raise EmptyReply on empty reply, no need to process further

pull/608/head
dgtlmoon 3 years ago
parent 67c833d2bc
commit 16809b48f8

@ -158,6 +158,9 @@ class base_html_playwright(Fetcher):
if response is None: if response is None:
raise EmptyReply(url=url, status_code=None) raise EmptyReply(url=url, status_code=None)
if len(page.content().strip()) == 0:
raise EmptyReply(url=url, status_code=None)
self.status_code = response.status self.status_code = response.status
self.content = page.content() self.content = page.content()
self.headers = response.all_headers() self.headers = response.all_headers()

Loading…
Cancel
Save