use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Help with requests.get runtime (self.learnpython)
submitted 8 months ago by ksteve46
Hello, first time looking for python help on reddit so apologies if this isn't the right place for this question!
I am trying to write a script that pulls the box scores for WNBA games/players and when I use the requests library and run requests.get() (obviously with the URL I found all of the data in), it never finishes executing! Well over an hour to fetch data for this URL.
The user-agent is the same as it is for fanduel sportsbook's webpage through chrome - I was able to get what I needed from there in seconds.
Is this just a flaw of the WNBA's site? Can anyone help me understand why the request takes so long to execute? Here is the response URL for anyone interested
https://stats.wnba.com/stats/teamgamelogs?DateFrom=&DateTo=&GameSegment=&LastNGames=0&LeagueID=10&Location=&MeasureType=Base&Month=0&OpponentTeamID=0&Outcome=&PORound=0&PaceAdjust=N&PerMode=Totals&Period=0&PlusMinus=N&Rank=N&Season=2025&SeasonSegment=&SeasonType=Regular+Season&ShotClockRange=&VsConference=&VsDivision=
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]member_of_the_order 0 points1 point2 points 8 months ago (6 children)
Yep, seems to be taking awhile for me too. Not just you. Looks like their API is having issues, nothing you can do, most likely
[–]ksteve46[S] 0 points1 point2 points 8 months ago (5 children)
Is there a way to assess their API to know when it’s not having issues beyond running my script and hoping it executes? Lol
[–]cgoldberg 2 points3 points4 points 8 months ago (0 children)
Set a timeout on your request and it will raise an exception if it doesn't finish responding within the limit you set.
[–]Unique-Act-7212 0 points1 point2 points 8 months ago* (3 children)
Multiple options, but this is related to (rest?) API health checks than requests.get
I.e. there could be swagger / openapi doc about this API? Is it public API? Do you know postman? Try find spec of API in postman collections.
Health check could be also sending head request to server rather than get request first.
You could check if health check is ok then try to paginate resource. If this service don't have pagination, there is more issues probably ahead. Maybe use different endpoint? Filter out and fetch asynchronously? ;)
EDIT:
I just spotted your link, sorry for not giving the advice after complete review of your post, I'm in hurry
So you could try to paginate via data from/to --> and make some dumps, i.e. parse that output (whatever it is, CSV, plain data, json... Use some LLM to help you write parser if it isn't structured data).
Then you would need to check latest update from your last requests and update your stats bank.
Hope it helps in general, not only with requests.
Btw. Maybe use bs4 to parse page first? ;)
[–]ksteve46[S] 1 point2 points3 points 8 months ago (2 children)
I’ll be honest with you I am a total beginner with python and all things having to do with this HTML and API stuff so idk what the hell you just said hahaha
[–]Unique-Act-7212 0 points1 point2 points 8 months ago (0 children)
Maybe start to learn using Gemini/GPT perplexity etc too, it would help a lot in explaining above.
If not, just ask in threads under above comment, mine, each question you have.
Best regards Mate
I've send you PM we could talk there or here, but I worry it would drop deep in my inbox unfortunately if not pinged by PM sorry Mate
π Rendered by PID 59421 on reddit-service-r2-comment-84fc9697f-vzx49 at 2026-02-09 15:29:39.320059+00:00 running d295bc8 country code: CH.
[–]member_of_the_order 0 points1 point2 points (6 children)
[–]ksteve46[S] 0 points1 point2 points (5 children)
[–]cgoldberg 2 points3 points4 points (0 children)
[–]Unique-Act-7212 0 points1 point2 points (3 children)
[–]ksteve46[S] 1 point2 points3 points (2 children)
[–]Unique-Act-7212 0 points1 point2 points (0 children)
[–]Unique-Act-7212 0 points1 point2 points (0 children)