Demo web crawler that generates page map for given domain.
- Java 11 (OpenJDK distribution (openjdk 11.0.2))
- Gradle 5.5
Make sure that Lombok plugin is installed and Enable annotation processing option is enabled in IDE.
- Clean project: ./gradlew clean
- Build project: ./gradlew build
- Run tests: ./gradlew clean test
- Run application: ./gradlew bootRun
- Run application:
./gradlew bootRun - Open
http://localhost:8080/swagger-ui.htmlin browser window - Define
domainparam andExecuterequest
As a Customer
I would like to get mocked page map with links for given domain
so that I will know page map initial contract.
As a Customer
I would like to get page map with all links from single domain URL
so that I will know what sub-pages are available for given URL.
As a Customer
I would like to get page map with all external links from single domain URL
so that I will know what external links are available for given URL.
As a Customer
I would like to get page map with links to static content from single domain URL
so that I will know what static content (images, pdfs) is available for given URL.
As a Customer
I would like to get page map for all pages under given domain URL
so that I will know links and static content for each sub-page within given domain.
As a Customer
I would like to get page map 50% faster
so that I can generate more page maps in the same time period.
As a Product Owner
I would like to control used resources (CPU & memory) during scraping process
so that web crawler re-uses resources (threads) and do not over-uses resources.
As a Consumer
I would like to generate page map via HTTP request (REST API)
so that page maps would be possible to generate over HTTP protocol.
As a Consumer
I would like to have access to API documentation and be able to perform test requests
so that Developer can familiar with API and test API.
As a Product Owner
I would like to what can be improved in application
so that web crawler will provide more business value for Customers and Developers.
-
Add more test cases.
Extend current test classes with border cases (e.g. wrong input, exceptions). -
Timeout scraping in situation when page loads too long.
-
Handle exceptions on API level.
Use@ExceptionHandlerand generate proper error output. -
Handle API requests in reactive way via
Spring WebFlux. -
Map domain object
PageMaptoDTOobject in API layer. -
Provide validation on API params to be sure that valid domain address passed.
-
Extend output by more static content types (e.g. docs, scripts).
-
Include pages for which scraping error occurred and such page is excluded from final output.
-
Measure service/API performance (e.g. response time, resources consumption, #RPS/s).
-
Provide info about total scraping time per domain.
-
Next to the domain provide parameter to exclude some websites (e.g. blogs, pressroom, etc.)
-
Dockerise application to use unified runtime environment.