Automate the login process on the Polar Flow website using Java, HttpURLConnection, and Jsoup.
- Java Development Kit (JDK) installed
- Active Polar Flow account https://flow.polar.com/register
- Download the repo to your machine.
- Open the project in your preferred Java IDE.
- Download required dependencies with Maven.
- Replace the placeholder values in the Main.java file with your actual email and password:
String postParams = "[email protected]&password=your-password&csrfToken=" + csrfToken;
- Save the changes and run the 'Main' class.
This Java program automates the login process on the Polar Flow website through the following steps:
- Sends a GET request to the Polar Flow login page to retrieve the CSRF token.
- Extracts the CSRF token from the response.
- Sends a POST request to the login page with the provided credentials and CSRF token.
- If the login is successful (HTTP OK), sends a GET request to the user's diary page.
- Extracts and prints the title and username from the diary page. Note: Please use your actual email and password in the Main.java file for proper functionality.
<!-- Jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.17.2</version>
</dependency>
This project is licensed under the MIT License - see the LICENSE file for details