- closes #232, University of Michigan library site does not work
- improved handling of scraper errors (hopefully, the hanging should be gone)
This commit is contained in:
parent
51e7c8fbef
commit
68c480b7b5
2 changed files with 12 additions and 5 deletions
|
@ -1095,9 +1095,7 @@ Scholar.Translate.prototype._itemDone = function(item) {
|
|||
if(this.type == "web") {
|
||||
if(!attachment.url && !attachment.document) {
|
||||
Scholar.debug("not adding attachment: no URL specified");
|
||||
}
|
||||
|
||||
if(attachment.downloadable && this._downloadAssociatedFiles) {
|
||||
} else if(attachment.downloadable && this._downloadAssociatedFiles) {
|
||||
if(attachment.document) {
|
||||
attachmentID = Scholar.Attachments.importFromDocument(attachment.document, myID);
|
||||
|
||||
|
@ -1223,7 +1221,16 @@ Scholar.Translate.prototype._runHandler = function(type, argument) {
|
|||
returnValue = this._handlers[type][i](this, argument);
|
||||
}
|
||||
} catch(e) {
|
||||
Scholar.debug(e+' in handler '+i+' for '+type);
|
||||
if(this._parentTranslator) {
|
||||
// throw handler errors if they occur when a translator is
|
||||
// called from another translator, so that the
|
||||
// "Could Not Translate" dialog will appear if necessary
|
||||
throw(e+' in handler '+i+' for '+type);
|
||||
} else {
|
||||
// otherwise, fail silently, so as not to interfere with
|
||||
// interface cleanup
|
||||
Scholar.debug(e+' in handler '+i+' for '+type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1773,7 +1773,7 @@ REPLACE INTO "translators" VALUES ('cf87eca8-041d-b954-795a-2d86348999d5', '2006
|
|||
if (prefix == ''x'') return namespace; else return null;
|
||||
} : null;
|
||||
|
||||
var xpath = ''/html/body/table/tbody/tr[td[1][@id="bold"]][td[2]]'';
|
||||
var xpath = ''//table/tbody/tr[td[1][@id="bold"] or td[@class="recordTD"]][td[2]]'';
|
||||
var elmts = newDoc.evaluate(xpath, newDoc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||
var elmt;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue