title: simple python web scraping with login
body: <p>I don't seem to be able to connect to a website to <strong>scrape</strong> it. I wonder if I do something wrong or not? I tried the same code on another website and it works, but I don't get any authentication error... I'd appreciate any help, thanks !</p>
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  login_url = 'https://secure.selfwealth.com.au/Account/Login?ReturnUrl=%2F'
  session = requests.Session()
  page = session.get(login_url)
  
  soup = BeautifulSoup(page.text, 'html.parser') 
  token = soup.find(attrs={&quot;name&quot;: '__aft'}).get('value')
  
  payload = {
      &quot;email&quot;: &quot;bob@gmail.com&quot;, 
      &quot;password&quot;: &quot;mypwd&quot;,
      &quot;__aft&quot;: token 
  }
  
  
  result = session.post(login_url, data=payload)
  page = session.get(login_url)
  #print(result.ok)
  
  soup = BeautifulSoup(page.content, 'html.parser')
  results = soup.find('div', class_='daily-perf')
  results2 = soup.find(&quot;title&quot;)
  #marketvalue = results.find('div', class_='price-change')
  print(results)
  print(results2)
  print(payload)
  </code></pre>