Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.hc.client5.http.fluent.Request;
- public class APIRequest {
- public static void main(final String... args) throws Exception {
- String apiUrl = "https://api.zenrows.com/v1/?apikey=<YOUR_ZENROWS_API_KEY>&url=https%3A%2F%2Fwww.zenrows.com%2Fblog%2Fweb-scraping-java&js_render=true&css_extractor=%257B%2522Product-price%2522%253A%2522%2523product-752%2520%253E%2520div.summary.entry-summary%2520%253E%2520p.price%2520%253E%2520span%2522%257D";
- String response = Request.get(apiUrl)
- .execute().returnContent().asString();
- System.out.println(response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement