vidageek / crawler Goto Github PK
View Code? Open in Web Editor NEWSimple java web crawler
Simple java web crawler
Decide what we should do when MimeType is null.
Currently, it raises a NPE.
the programe will be dead if running large scale task!!!
DefaultNormalizer should concatenate relative url begin with '?' with the url which conatains it, not the base url.
For example, if the base url is http://www.some.com, when crawler follows the relative url "?pageno=3" in page http://www.some.com/sample, the DefaultNormalizer will return http://www.some.com?pageno=3,but not http://www.some.com/sample?pageno=3, which it should be.
I solved this problem by change the interface method signature from LinkNormalizer#String normalize( final String relativeUrl) to String normalize(final String urlToCrawl, final String relativeUrl), and in PageCrawlerExecutor#run() invoke normalizer.normalize(urlToCrawl.link(), l);
Hi, crawler.
I find may be there is one logic error in PageCrawlerExecutor's run() method.
" String link = normalizer.normalize(l); ", this will get link alawys relate baseUrl, but in pratice
we should get link every time relate last urlToCrawl.
I change it to " String link = Utils.normalize(urlToCrawl.link(), l); "
public static String normalize(final String beginUrl, String url) {
url = url.replaceAll("&", "&");
return UrlUtils.resolveUrl(beginUrl, url);
}
I do not whether it's error, but after change this code, i get the result i wanted.
More word, this project is good indeed. I like it.
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.