mape/node-scraper — Issue #11: Incatchable errors
Author: akidee
Created: 2011-10-30 19:45:00+00:00
State: open

When scraping google.de, I get:

Error: Invalid character: Invalid character in tag name: ){
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:420:27)
at Function.clean (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:18:317)
at Function.buildFragment (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:17:31854)
at [object Object].init (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:16:7963)
Error: Invalid character: Invalid character in tag name: )
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:420:27)
at Function.clean (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:18:317)
at Function.buildFragment (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:17:31854)
Error: Invalid character: Invalid character in tag name: )
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
Error: Invalid character: Invalid character in tag name: ;
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
Error: Invalid character: Invalid character in tag name: ;++
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:420:27)
at Function.clean (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:18:317)
at Function.buildFragment (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:17:31854)
Error: Invalid character: Invalid character in tag name: ){
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:420:27)
at Function.clean (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:18:317)
at Function.buildFragment (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:17:31854)
at [object Object].init (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:16:7963)
Error: Invalid character: Invalid character in tag name: )
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:420:27)
at Function.clean (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:18:317)
at Function.buildFragment (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:17:31854)
Error: Invalid character: Invalid character in tag name: )
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
Error: Invalid character: Invalid character in tag name: ;
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
Error: Invalid character: Invalid character in tag name: ;++
at Object.createElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/level1/core.js:1190:13)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:128:35)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at setChild (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:171:7)
at HtmlToDom.appendHtmlToElement (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/andi/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:420:27)
at Function.clean (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:18:317)
at Function.buildFragment (/Users/andi/node_modules/scraper/deps/jquery-1.6.1.min.js:17:31854)

Surely, HTML is usually not correct, but syntax tolerance is expected by clients. The scraping and analyzing seems to work, but the errors are not suppressable.