adding keiths changes from dev list
This commit is contained in:
parent
3a5da5e6df
commit
1de4502a1a
1 changed files with 23 additions and 26 deletions
|
@ -41,11 +41,11 @@ function scrape(doc, url) {
|
|||
var newItem = new Zotero.Item("book");
|
||||
|
||||
|
||||
var headers = doc.evaluate('//td[2]/pre/b', doc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||
var xPathCount = doc.evaluate('count (//td[2]/pre/b)', doc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||
var contents = doc.evaluate('//td[2]/pre', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
||||
var headers = doc.evaluate('//td[2]/pre/b', doc, nsResolver,XPathResult.ANY_TYPE, null);
|
||||
var xPathCount = doc.evaluate('count (//td[2]/pre/b)', doc,nsResolver, XPathResult.ANY_TYPE, null);
|
||||
var contents = doc.evaluate('//td[2]/pre', doc, nsResolver,XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
||||
|
||||
var headersArray = new Array();
|
||||
var headersArray = new Array();
|
||||
var oneHeader = '';
|
||||
|
||||
if (xPathCount.numberValue > 1) {
|
||||
|
@ -83,15 +83,12 @@ function scrape(doc, url) {
|
|||
associateData (newItem, dataTags, "VOLUME_NO", "volume");
|
||||
associateData (newItem, dataTags, "REMARKS", "extra");
|
||||
associateData (newItem, dataTags, "SUMMARY", "abstractNote");
|
||||
|
||||
associateData (newItem, dataTags, "SOURCE", "series");
|
||||
if (dataTags["DESCRIPTION"]) {
|
||||
associateData (newItem, dataTags, "DESCRIPTION", "title");
|
||||
} else {
|
||||
newItem.title = "No Title Found";
|
||||
}
|
||||
|
||||
newItem.url = doc.location.href;
|
||||
|
||||
newItem.complete();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue