Detect CAPTCHA

This commit is contained in:
Simon Kornblith 2013-01-29 17:43:30 -05:00
parent 7cd3479094
commit 6dd420458f

View file

@ -488,7 +488,8 @@ Zotero_RecognizePDF.Recognizer.prototype._queryGoogle = function() {
Zotero_RecognizePDF.Recognizer.prototype._scrape = function(/**Zotero.Translate*/ translate) {
if(this._hiddenBrowser.contentDocument.location.href == "about:blank") return;
if(this._hiddenBrowser.contentDocument.title == "403 Forbidden") {
if(Zotero.Utilities.xpath(this._hiddenBrowser.contentDocument, "//form[@action='Captcha']").length ||
this._hiddenBrowser.contentDocument.location.toString().indexOf("/sorry") !== -1) {
// hit the captcha
/*
var forms = this._hiddenBrowser.contentDocument.getElementsByTagName("form");