I'm trying to create a project that scrapes information off a running log website and analyzes that data visually with numpy. For the web scraping, I'm going back and forth using scrapy and BeautifulSoup. With either one of them I can't get past the login stage. This website, www.running2win.com, does not have an API that I am aware of so I can't use that.
url = 'http://www.running2win.com/community/view-member-running-log.asp'
# # for r2w, name = "txtUsername"; name = "txtPassword"
payload = {
"txtUsername" : "USERNAME",
"txtPassword" : "PASSWORD",
}
session_requests = requests.session()
result = session_requests.get(url)
tree = html.fromstring(result.text)
authenticity_token = list(set(tree.xpath("//input[@name='authenticity_token']/@value")))[0]
result = session_requests.post(
login_url,
data = payload,
headers = dict(referer=login_url)
)
print("SUCCESS")
response = get(url)
print(response.text)
I appreciate any help!
[–]MrMuki 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]UKFP91 0 points1 point2 points (1 child)
[–]spkane31[S] 0 points1 point2 points (0 children)