bugfixed pageStatusCode

This commit is contained in:
rafaelsideguide 2024-07-02 10:51:35 -03:00
parent 50eecf04a9
commit 7b7154ba1e

View File

@ -518,12 +518,13 @@ export async function scrapSingleUrl(
html = attempt.html ?? ""; html = attempt.html ?? "";
rawHtml = attempt.rawHtml ?? ""; rawHtml = attempt.rawHtml ?? "";
screenshot = attempt.screenshot ?? ""; screenshot = attempt.screenshot ?? "";
if (attempt.pageStatusCode) { if (attempt.pageStatusCode) {
pageStatusCode = attempt.pageStatusCode; pageStatusCode = attempt.pageStatusCode;
} }
if (attempt.pageError && attempt.pageStatusCode != 200) { if (attempt.pageError && attempt.pageStatusCode >= 400) {
pageError = attempt.pageError; pageError = attempt.pageError;
} else { } else if (attempt.pageStatusCode < 400) {
pageError = undefined; pageError = undefined;
} }