whimtrip / jwht-htmltopojo Goto Github PK
View Code? Open in Web Editor NEWFully Featured, highly pluggable and customizable Java Html to Pojo converter.
License: MIT License
Fully Featured, highly pluggable and customizable Java Html to Pojo converter.
License: MIT License
I tried to parse an integer value, that had a comma delimiter, like '1,234' and faced a problem with conversion with locale.
fr.whimtrip.ext.jwhtscrapper.exception.ModelBindingException: Scrap failed with exception Cannot parse field fiveStarsCount.class com.service.parser.pojo.ProductPojo with value 1,626 and locale: us.
at fr.whimtrip.ext.jwhthtmltopojo.adapter.AbstractHtmlFieldImpl.instanceForNode(AbstractHtmlFieldImpl.java:201) ~[whimtrip-ext-htmltopojo-1.0.2.jar:na]
So, we need to respect locale while conversion number values, because currently an example like this
@Selector(
value = ".example ",
locale = 'US',
returnDefValueOnThrow = false
)
public Integer fiveStarsCount;
can't be correctly casted. To use locale during number conversion we need to use method like this
Number number = NumberFormat.getIntegerInstance(Locale.US).parse('123,45');
This is default realiztaion of conversion at castValue in HtmlToPojoUtils
if (clazz.equals(Integer.class) || clazz.equals(int.class)) {
if(value.equals(Selector.NO_VALUE))
return (U) DEFAULT_NOT_FOUND_INTEGER;
return (U) Integer.valueOf(value);
}
My question is - can we solve this problem without using custom deserializer? Because currently this problem is in each of hundreds of Integer fields
Hi
With the help your API how to extract data from the following url?
https://www.icicidirect.com/idirectcontent/Research/TechnicalAnalysis.aspx/companyprofile/inftec
mainly i need table data. Second thing in same session or after this url call how to get data from other url which you can find left hand side of this Page?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.