Skip to content

Commit

Permalink
Fixing a bug with reading response bytes in playwright/camoufox when …
Browse files Browse the repository at this point in the history
…`network_idle` is used

PlayWright doesn't provide a way to get the response in bytes after all wait ends like `page.content()` so that's more efficient to do anyway
  • Loading branch information
D4Vinci committed Nov 20, 2024
1 parent 1473803 commit 4c74d9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scrapling/engines/camo.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def fetch(self, url: str) -> Response:
response = Response(
url=res.url,
text=page.content(),
body=res.body(),
body=page.content().encode('utf-8'),
status=res.status,
reason=res.status_text,
encoding=encoding,
Expand Down
2 changes: 1 addition & 1 deletion scrapling/engines/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def fetch(self, url: str) -> Response:
response = Response(
url=res.url,
text=page.content(),
body=res.body(),
body=page.content().encode('utf-8'),
status=res.status,
reason=res.status_text,
encoding=encoding,
Expand Down

0 comments on commit 4c74d9b

Please sign in to comment.