Python reading url that requires logging in -
i use
player_id = re.compile('<td><a href="(.+?)" onclick=') url = 'http://www.csfbl.com/freeagents.asp?leagueid=2237' sock = urllib.request.urlopen(url).read().decode("utf-8")
or
import pandas pd pd.read_html(url)
the website in question displays 2 different values based on whether logged in or not. how can values if logged in?
is website.
thanks in advance!
use requests module submit credentials on web-form at: http://www.csfbl.com/logon.asp .
instructions submitting web forms using requests can found here: http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests
other sites can more challenging. those, consider using selenium or mechanize.
Comments
Post a Comment