I am trying to scrape information from a website that requires you to log in, but when I use BeautifulSoup there aren't any forms that appear on the site. Here's the code I'm using:
import mechanize
import http.cookiejar
from bs4 import BeautifulSoup
# Browser
br = mechanize.Browser()
# Cookie Jar
cj = http.cookiejar.LWPCookieJar()
br.set_cookiejar(cj)
# Browser options
br.set_handle_equiv(True)
br.set_handle_gzip(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
#br.addheaders = [('User-agent', 'Chrome')]
# The site we will navigate into, handling it's session
br.open('https://underdogfantasy.com/')
br.forms()
I have to click the "Sign In" button on the website for the prompt to appear, but there isn't a unique URL that's created like there is for some sites. What might I be missing?