Skip to content

Commit

Permalink
Springer Link: Support new book chapter list structure
Browse files Browse the repository at this point in the history
Fixes #3302
  • Loading branch information
AbeJellinek committed May 9, 2024
1 parent ffb252e commit 3871bb2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Springer Link.js
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2024-03-11 17:59:13"
"lastUpdated": "2024-05-09 16:39:27"
}

/*
Expand Down Expand Up @@ -89,6 +89,11 @@ function getResultList(doc) {
if (!results.length) {
results = doc.querySelectorAll('li[data-test="chapter"] h4.c-card__title > a, li[data-test="chapter"] h3.c-card__title > a');
}
// https://link.springer.com/book/10.1007/978-3-476-05742-6
// https://link.springer.com/book/10.1007/978-3-319-63324-4
if (!results.length) {
results = doc.querySelectorAll('li[data-test="chapter"] [data-test^="chapter-title"] > a');
}
// https://link.springer.com/journal/11192/volumes-and-issues/129-1
if (!results.length) {
results = doc.querySelectorAll('section ol article.c-card-open h3 > a');
Expand Down Expand Up @@ -647,6 +652,16 @@ var testCases = [
"type": "web",
"url": "https://link.springer.com/journal/10473/volumes-and-issues/44-3",
"items": "multiple"
},
{
"type": "web",
"url": "https://link.springer.com/book/10.1007/978-3-319-63324-4",
"items": "multiple"
},
{
"type": "web",
"url": "https://link.springer.com/book/10.1007/978-3-476-05742-6",
"items": "multiple"
}
]
/** END TEST CASES **/

0 comments on commit 3871bb2

Please sign in to comment.