Add debug for menuGroup/menuSection structure detection
This commit is contained in:
parent
bed088d0ff
commit
794d2ceee5
1 changed files with 9 additions and 7 deletions
|
|
@ -265,13 +265,15 @@
|
|||
</cfloop>
|
||||
<cfset response["DEBUG_H4_TAGS"] = h4Texts>
|
||||
|
||||
<!--- Debug: show raw HTML snippet around first h3 tag --->
|
||||
<cfset h3Pos = findNoCase("<h3", combinedHtml)>
|
||||
<cfif h3Pos GT 0>
|
||||
<cfset snippetStart = max(1, h3Pos - 200)>
|
||||
<cfset snippetEnd = min(len(combinedHtml), h3Pos + 500)>
|
||||
<cfset response["DEBUG_HTML_SNIPPET"] = mid(combinedHtml, snippetStart, snippetEnd - snippetStart)>
|
||||
</cfif>
|
||||
<!--- Debug: find menuGroup and menuSection divs --->
|
||||
<cfset menuGroupMatches = reMatchNoCase("<div[^>]*class=""[^""]*menuGroup[^""]*""[^>]*>", combinedHtml)>
|
||||
<cfset menuSectionMatches = reMatchNoCase("<section[^>]*class=""[^""]*menuSection[^""]*""[^>]*>", combinedHtml)>
|
||||
<cfset response["DEBUG_MENU_GROUPS"] = arrayLen(menuGroupMatches)>
|
||||
<cfset response["DEBUG_MENU_SECTIONS"] = arrayLen(menuSectionMatches)>
|
||||
|
||||
<!--- Extract all span/div text that might be subcategory headers --->
|
||||
<cfset subcatHeaders = reMatchNoCase("<(span|div)[^>]*class=""[^""]*header[^""]*""[^>]*>([^<]+)<", combinedHtml)>
|
||||
<cfset response["DEBUG_SUBCAT_HEADERS"] = subcatHeaders>
|
||||
<cfset arrayAppend(response.steps, "Found " & arrayLen(h3Texts) & " h3 and " & arrayLen(h4Texts) & " h4 tags")>
|
||||
|
||||
<!--- System prompt for URL analysis --->
|
||||
|
|
|
|||
Reference in a new issue