27 lines
1.0 KiB
Java
27 lines
1.0 KiB
Java
package org.example;
|
|
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.Connection;
|
|
|
|
public class TestAthleteJson {
|
|
public static void main(String[] args) {
|
|
// Club ID 1 (Arvore) and Modality 1 (Senior)
|
|
String url = "https://api.afavcd.pt/teams/1/modality/1/season/33";
|
|
System.out.println("Testing: " + url);
|
|
try {
|
|
Connection.Response response = Jsoup.connect(url)
|
|
.ignoreContentType(true)
|
|
.userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64)")
|
|
.header("Referer", "https://www.afavcd.pt/")
|
|
.header("Origin", "https://www.afavcd.pt")
|
|
.method(Connection.Method.GET)
|
|
.execute();
|
|
if (response.statusCode() == 200) {
|
|
System.out.println("Result: " + response.body().substring(0, Math.min(response.body().length(), 2000)));
|
|
}
|
|
} catch (Exception e) {
|
|
System.out.println("Failed: " + e.getMessage());
|
|
}
|
|
}
|
|
}
|