Advertisement
dereksir

Untitled

Mar 27th, 2024 (edited)
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import org.apache.hc.client5.http.fluent.Request;
  2.  
  3. public class APIRequest {
  4.     public static void main(final String... args) throws Exception {
  5.         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";
  6.         String response = Request.get(apiUrl)
  7.                 .execute().returnContent().asString();
  8.  
  9.         System.out.println(response);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement