Skip to content

[Bug]: #12

@citizenfish

Description

@citizenfish

Preliminary Checks

  • I have searched existing issues for similar problems
  • I have read the troubleshooting documentation
  • I am using a supported version of HeadlessX

HeadlessX Version

v1.3.0

Installation Method

Docker

Environment

Ubuntu

Bug Description

Internal errors caused when attempting to extract Facebook public page content

headlessx  | [2025-10-20T13:46:47.372Z] [req_1760968007371_d9ffvo4hb] [INFO] Advanced content extraction for: https://www.facebook.com/groups/448725649556297/posts/1330019071426946/ 
headlessx  | [2025-10-20T13:46:47.373Z] [req_1760968007372_j9wt1vwxd] [INFO] Starting v1.3.0 enhanced rendering: https://www.facebook.com/groups/448725649556297/posts/1330019071426946/ [mid-range-desktop/us-east/natural] 
headlessx  | [2025-10-20T13:46:47.421Z] [req_1760968007372_j9wt1vwxd] [INFO] Navigating to: https://www.facebook.com/groups/448725649556297/posts/1330019071426946/ 
headlessx  | [2025-10-20T13:46:47.421Z] [req_1760968007372_j9wt1vwxd] [WARN] NetworkIdle2 failed, trying domcontentloaded... 
headlessx  | [2025-10-20T13:46:48.302Z] [req_1760968007372_j9wt1vwxd] [INFO] Standard navigation completed (domcontentloaded) 
headlessx  | [2025-10-20T13:46:58.303Z] [req_1760968007372_j9wt1vwxd] [INFO] Page loaded successfully 
headlessx  | [2025-10-20T13:46:58.303Z] [req_1760968007372_j9wt1vwxd] [INFO] Applying v1.3.0 advanced stealth and behavioral simulation... 
headlessx  | 🎭 Applying advanced playwright-stealth fingerprinting...
headlessx  | ✅ Advanced playwright-stealth fingerprinting complete
headlessx  | [2025-10-20T13:46:58.436Z] [req_1760968007372_j9wt1vwxd] [INFO] Simulating human behavior [natural profile] 
headlessx  | ⚠️ Human-like auto scroll failed: Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.
headlessx  | [2025-10-20T13:47:04.417Z] [req_1760968007372_j9wt1vwxd] [INFO] Forcing desktop CSS and layout... 
headlessx  | [2025-10-20T13:47:04.421Z] [req_1760968007372_j9wt1vwxd] [INFO] Waiting for JavaScript execution... 
headlessx  | [2025-10-20T13:47:06.425Z] [req_1760968007372_j9wt1vwxd] [INFO] Simulating enhanced human behavior [natural]... 
headlessx  | 🎭 Starting enhanced human behavior simulation...
headlessx  | [2025-10-20T13:47:09.041Z] [req_1760968029041_hdqao3zlb] [INFO] Enhanced health check requested {"status":"healthy","version":"1.3.0"}
headlessx  | ✅ Enhanced human behavior simulation completed
headlessx  | [2025-10-20T13:47:11.984Z] [req_1760968007372_j9wt1vwxd] [INFO] Auto-scrolling with natural behavior pattern... 
headlessx  | ⚠️ Human-like auto scroll failed: Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.
headlessx  | [2025-10-20T13:47:11.984Z] [req_1760968007372_j9wt1vwxd] [INFO] Waiting for network idle... 
headlessx  | [2025-10-20T13:47:11.986Z] [req_1760968007372_j9wt1vwxd] [INFO] Extracting final content with inline CSS... 
headlessx  | [2025-10-20T13:47:12.316Z] [req_1760968007372_j9wt1vwxd] [INFO] Content fully extracted - Length: 1368181 chars 
headlessx  | Error in browser-based text extraction: page.evaluate: TypeError: className.includes is not a function
headlessx  |     at Object.acceptNode (eval at evaluate (:290:30), <anonymous>:81:47)
headlessx  |     at eval (eval at evaluate (:290:30), <anonymous>:96:38)
headlessx  |     at UtilityScript.evaluate (<anonymous>:292:16)
headlessx  |     at UtilityScript.<anonymous> (<anonymous>:1:44)
headlessx  |     at extractCleanText (/app/src/utils/helpers.js:183:44)
headlessx  |     at async renderContent (/app/src/controllers/rendering.js:166:33)
headlessx  | [2025-10-20T13:47:14.295Z] [req_1760968007371_d9ffvo4hb] [INFO] Successfully extracted content: https://www.facebook.com/groups/448725649556297/posts/1330019071426946/ (complete)

Expected Behavior

No error thrown

Actual Behavior

See logs above

Steps to Reproduce

POST http://172.16.0.170:7654/api/content?token=<TOKEN>
Content-Type: application/json

{
  "url": "https://www.facebook.com/groups/448725649556297/posts/1330019071426946/"
}

Error Logs

HTTP/1.1 500 Internal Server Error
X-Powered-By: Express
Vary: Origin
Access-Control-Allow-Credentials: true
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: text/plain; charset=utf-8
X-Request-ID: 2e5cb222-9959-42be-8f0b-063294dad7cb
X-Timestamp: 2025-10-20T13:52:53.762Z
X-Rendered-URL: https://www.facebook.com/groups/448725649556297/posts/1330019071426946/
Content-Length: 143
ETag: W/"8f-GZnnL/pAsKcjhkER6WP+WLEVJXY"
Date: Mon, 20 Oct 2025 13:52:55 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"error":"Content validation failed","message":"Invalid character in header content [\"X-Page-Title\"]","timestamp":"2025-10-20T13:52:55.724Z"}

Response code: 500 (Internal Server Error); Time: 25860ms (25 s 860 ms); Content length: 143 bytes (143 B)

Configuration

Severity

Medium (some functionality impaired)

Browser Context

None

Additional Context

No response

Contribution

  • I am willing to help fix this bug
  • I can provide additional testing
  • I can help with documentation updates

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions