Fix DoorDash image import: scroll page in Playwright to trigger lazy-loaded images

- Update render.js on dev server to scroll page before capturing images
- Increase Playwright wait from 4s to 5s and timeout from 90s to 120s
- Upsize DoorDash CDN thumbnails from 150px to 600px when downloading

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-03-10 11:20:10 -07:00
parent 9a28091601
commit f58d567fb4
2 changed files with 7 additions and 1 deletions

View file

@ -1044,7 +1044,7 @@
<cfset arrayAppend(response.steps, "Fetching URL with Playwright: " & targetUrl)>
<cfset playwrightOutput = "">
<cfexecute name="/opt/playwright/run.sh" arguments="'#targetUrl#' 4000" timeout="90" variable="playwrightOutput" />
<cfexecute name="/opt/playwright/run.sh" arguments="'#targetUrl#' 5000" timeout="120" variable="playwrightOutput" />
<cfif NOT len(trim(playwrightOutput))>
<cfthrow message="Playwright returned empty response">

View file

@ -85,6 +85,12 @@ function downloadItemImage(itemID, imageUrl) {
return false;
}
// Upsize DoorDash CDN thumbnails to 600px for better quality
if (findNoCase("cdn4dd.com/p/", imageUrl) && findNoCase("width=150", imageUrl)) {
imageUrl = replaceNoCase(imageUrl, "width=150", "width=600");
imageUrl = replaceNoCase(imageUrl, "height=150", "height=600");
}
// Download the image
http url="#imageUrl#" method="GET" timeout="30" result="httpResult" {
httpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";