title: How to send a get request then parse it to get the token and again use the same session to send a post request with that token to website in C#?
body: <p>I need to send a get request (sessions) to a website that contains a hidden token as <code>"__RequestVerificationToken"</code>. Afterthat, I want to parse the token and again send the post request with UserName, Password and also this parsed hiddenToken.</p>
  
  <p>I know how to do it in python, this is the following code to implement in python:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  session = requests.session() # Session Created
  url ="some URL"
  initial_login = session.get(url) # sending a get request to parse the token
  soup = BeautifulSoup(initial_login.text,'html.parser')
  token=soup.find('input') # used BeautifulSoup to find token
  payload = { 'Username':'username','Password':'password','__RequestVerificationToken':token['value']}
  login_done = session.post(url,data=payload)
  login_cookie= login_done.cookies['APILogin']
  </code></pre>
  
  <p>Please tell me how to achieve the same in C#...</p>