DroidsOnRoids / jspoon

Annotation based HTML to Java parser + Retrofit converter
https://www.thedroidsonroids.com/blog/scraping-web-pages-with-retrofit-jspoon-library
MIT License
323 stars 23 forks source link

Use default value on no match regardless of ElementConverter presence #74

Closed veyndan closed 1 year ago

veyndan commented 5 years ago

Closes #72.

When no match occurs, Jspoon should use the default value given by the user instead of passing null to the node of ElementConverter. ElementConverter shouldn't receive null as the Javadoc of Selector#converter states that the converter should only be used for matched (i.e. non-null) elements:

https://github.com/DroidsOnRoids/jspoon/blob/2159364d151d9947ff0b3a04d07f8f703e546f9c/jspoon/src/main/java/pl/droidsonroids/jspoon/annotation/Selector.java#L66-L68