Web Scraping Discover Credit Card Login

Casey White 1 Reputation point
2021-08-17T17:15:57.967+00:00

Hello! I am trying to web scrape discover credit card to automate some tasks I have for my account. I am able to do this on other websites but for some reason discover returns as logged out.

The title is Discover Card: You Are Logged Out

So I don’t get the table for transactions returned.

Here is my code:

$userID = ‘username’
$password = ‘password’

$web = Invoke-WebRequest “https://portal.discover.com/customersvcs/universalLogin/ac_main” -SessionVariable discoverSession

$form = $web.Forms[1]
$form.Fields[‘userID’] = $userID
$form.Fields[‘password’] = $password

$sess = Invoke-WebRequest -Uri ("https://card.discover.com/cardmembersvcs/statements/app/activity#/recent" + $form.Action) -WebSession $discoverSession -Method Post -Body $form.Fields

I must be missing something? Thanks for any help!!!

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,536 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.