diff --git a/.gitignore b/.gitignore index 2e33739ec64..e3abb530fc8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,11 @@ src/main/gen/ src/main/generated/ src-gen/ + .lycheecache +jcef-bundle/ + javafx/javafx-sdk-* javafx/javafx-jmods-* javafx/javafx.html diff --git a/build.gradle b/build.gradle index fd199a8b667..a14365f4a56 100644 --- a/build.gradle +++ b/build.gradle @@ -255,10 +255,13 @@ dependencies { implementation 'org.controlsfx:controlsfx:11.2.1' + // region HTTP clients + implementation 'com.machinepublishers:jbrowserdriver:1.1.1' // used for web scraping; https://github.com/jcefmaven/jcefmaven implementation 'org.jsoup:jsoup:1.18.1' implementation 'com.konghq:unirest-java-core:4.4.4' implementation 'com.konghq:unirest-modules-gson:4.4.4' implementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1' + // endregion implementation 'org.slf4j:slf4j-api:2.0.16' implementation 'org.tinylog:tinylog-api:2.7.0' diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index b69f1d607a5..8fbad5a1285 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit b69f1d607a57488276f3402bbf610d9129e7f6fb +Subproject commit 8fbad5a1285926b177803087b35b0eb6b0fd0142 diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 040717bf907..917c976d138 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -90,10 +90,14 @@ requires org.glassfish.hk2.api; // region: http clients - requires unirest.java.core; - requires unirest.modules.gson; + requires transitive jbrowserdriver; + requires org.openqa.selenium.core; + requires org.openqa.grid.selenium; + requires org.openqa.selenium.remote; requires org.apache.httpcomponents.core5.httpcore5; requires org.jsoup; + requires unirest.java.core; + requires unirest.modules.gson; // endregion // region: SQL databases diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ACS.java b/src/main/java/org/jabref/logic/importer/fetcher/ACS.java index 3c81d89db2a..266bbda282f 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ACS.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ACS.java @@ -10,14 +10,16 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; +import com.machinepublishers.jbrowserdriver.JBrowserDriver; +import com.machinepublishers.jbrowserdriver.Settings; +import com.machinepublishers.jbrowserdriver.Timezone; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * FulltextFetcher implementation that attempts to find a PDF URL at ACS. + * FulltextFetcher implementation that attempts to find a PDF URL at ACS. + * + * Alternatives concidered: https://stackoverflow.com/a/53099311/873282 */ public class ACS implements FulltextFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(ACS.class); @@ -25,35 +27,33 @@ public class ACS implements FulltextFetcher { private static final String SOURCE = "https://pubs.acs.org/doi/abs/%s"; /** - * Tries to find a fulltext URL for a given BibTex entry. - *
- * Currently only uses the DOI if found.
- *
- * @param entry The Bibtex entry
- * @return The fulltext PDF URL Optional, if found, or an empty Optional if not found.
- * @throws NullPointerException if no BibTex entry is given
- * @throws java.io.IOException
+ * Tries to find a fulltext URL for a given BibTeX entry.
+ * Requires the entry to have a DOI field.
+ * In case no DOI is present, an empty Optional is returned.
*/
@Override
public Optional