When running pybaseball functions in my Python code, I am unable to use any of the package's functions because I get the following error:
get_pitching_leaders("AL")
HTTPError: Error accessing 'https://www.fangraphs.com/leaders-legacy.aspx'. Received status code 403.
I am also unable to run the functions pitching_stats() and batting_stats() as the throw the same error. When I click on this link (in the error above), it seems Fangraphs is asking for a security check (some sort of CAPTCHA) so Python is unable to access the site and thus, cannot run the code in the functions.
Python / Version Details
Python version: 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)]
pybaseball version: 2.2.7
pip-26.0.1
Can someone please look into how to fix this error? I would be happy to provide more details if needed. Thank you!
When running
pybaseballfunctions in my Python code, I am unable to use any of the package's functions because I get the following error:I am also unable to run the functions
pitching_stats()andbatting_stats()as the throw the same error. When I click on this link (in the error above), it seems Fangraphs is asking for a security check (some sort of CAPTCHA) so Python is unable to access the site and thus, cannot run the code in the functions.Python / Version Details
Can someone please look into how to fix this error? I would be happy to provide more details if needed. Thank you!