Skip to content

pera-soft/jsoup-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jsoup Example

Automate the login process on the Polar Flow website using Java, HttpURLConnection, and Jsoup.

Prerequisites

How To Run

  • 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.

Description

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.

Maven Dependdencies

    <!-- Jsoup -->
    <dependency>
        <groupId>org.jsoup</groupId>
        <artifactId>jsoup</artifactId>
        <version>1.17.2</version>
    </dependency>

License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages