I am trying to scrape the following page: https://www.fanduel.com/games/57764/contests/57764-245891325/scoring
The following code that uses urlopen() produced a certificate verify failed error:
url = 'https://www.fanduel.com/games/57764/contests/57764-245891325/scoring'
html = urlopen(url)
soup = BeautifulSoup(html, 'html.parser')
Error: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)>
I also tried using the following code, but I've received a <response [403]>
html = f'https://www.fanduel.com/games/57764/contests/57764-245891325/scoring'
r = get(html, verify=False)
Would greatly appreciate any suggestions for scraping this site, whether that's a code update or a recommendation to use a different web-scraping package. Thanks!
UPDATE PER Maxlovesairandteslas Response:
I'm now encountering a new error. Within the response it says: access to this page has been denied. I updated my code as such, so I'm assuming that I'm at least getting through to the appropriate page and now being denied:
with requests.Session() as s:
p = s.post("fanduel.com/login", verify=False, data={"email": "","password": ""})
base_page = s.get('fanduel.com/games/57764/contests/57764-245891325/scoring')#, headers=headers)
soup = BeautifulSoup(base_page.content, 'html.parser')
print(soup.prettify())