Skip to content
Advertisement

Logging in to a website with Jsoup which redirects, and scraping a page that isn’t the redirect

This is the website I’m trying to scrape from.

I’m able to login to the website fairly easily. However, I’m unable to retrieve and reuse the cookies or session ID to scrape a page other than the one the login page redirects to. I receive a 403 everytime.

Here is an example of what I’ve tried:

JavaScript

Advertisement

Answer

This code works for me:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement