I need help finding a good library for web scraping on Android that can handle dynamic content. Here’s what I’m trying to do:
My Requirements:
- Load web pages completely in the background without showing them
- Handle JavaScript and AJAX calls that load content after page loads
- Extract data using CSS selectors or XPath
- Eventually simulate clicks and form submissions
What I’ve Tested:
- Jsoup - Great for static HTML but can’t run JavaScript
- Built-in HTTP clients - Same JavaScript limitation as Jsoup
- HtmlUnit - Perfect features but won’t work on Android (missing java.awt and other dependencies)
- Rhino - Too complicated and not sure if it fits my needs
- Selenium WebDriver - Might work but seems hard to run headless on mobile
I really hoped HtmlUnit would work since it has everything I need. Has anyone found a working alternative that supports JavaScript execution on Android? I’m using Android Studio but can switch to Eclipse if that helps.
Any suggestions would be greatly appreciated!