How to scrape SPORTS STATS websites with Python

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 95

  • @chr1sto7
    @chr1sto7 4 года назад +18

    I don’t know why you don’t have more subscribers. You’re great man. Keep up the good work.
    You really helped me with a web scraping project for my parents and you have given me the tools to begin a project at work using a REST api. Really helped me a lot! Thanks!!!

    • @ephraimmotho887
      @ephraimmotho887 Год назад +2

      2 years have gone by. Subscribers: 44.1k (and growing...). Consistency is beautiful!!! Well done John

  • @celerystalk390
    @celerystalk390 4 года назад +12

    I learn something new in every video of yours! Looking forward to learning more from you. Keep up the great work!

  • @dfsed1057
    @dfsed1057 2 года назад +1

    Heck of a video; been doing data scraping for a while and yet learned several new things here. instant subscriber

  • @obinnaihekona1199
    @obinnaihekona1199 3 года назад +1

    This video singlehandedly helped me with a project that kept me up for 2 nights straight. Thank you so much for your content.

  • @canal_vhs
    @canal_vhs 4 года назад +6

    Awesome job. I'll need several months to learn everything you're teaching us. Thank you!

  • @sayantansarkar6433
    @sayantansarkar6433 4 года назад +4

    Mind blowing explanation and coding.. hats off my friend..

  • @gisleberge4363
    @gisleberge4363 3 года назад +2

    Very elegant and smooth solution

  • @brkerd6865
    @brkerd6865 4 года назад +5

    Easy, fast and understandable tutorial. Thanks for this, It is just what I'm looking for

    • @brkerd6865
      @brkerd6865 4 года назад +2

      I also subbed you are amazing

  • @pr0skis
    @pr0skis 4 года назад +3

    Awesome video! Thanks for introducing me to Postman. It helped me through a hurdle I've been struggling with for a while haha

  • @julianhristov5844
    @julianhristov5844 3 года назад +1

    Excellent job John, best tutorials ever. I applying for job, which they want me to do this kind of task and I do it perfect with your expert level knowledge .Thanks again.

  • @fsamobby
    @fsamobby 4 года назад +3

    Thanks for the valuable tip! This postman service is exactly what i was looking for but don't even realise d this))
    knowing what to ask is sometimes more important than the answer itself)

  • @brandonbergstrom4289
    @brandonbergstrom4289 Год назад +1

    Great video! Took me two minutes of watching this video and solved my problem. Thank you for your hard work and sharing!

  • @andresalcocer4544
    @andresalcocer4544 2 года назад +2

    Absolutely fantastic! really loved this tutorial, straight to the point and useful information!

  • @edsonmatheus7976
    @edsonmatheus7976 2 года назад

    Wow, I'm impressed. 13 minutes of pure master class, this video was so detailed!
    Got a new subscribe, greeting from Brazil!!!

  • @sandutiron8004
    @sandutiron8004 3 года назад +1

    Your videos are inspiring me every single day!

  • @Epitaxi
    @Epitaxi 3 года назад +1

    Simple amazing guide. I was able to scrape all player data from the Swedish Allsvenskan fantasy site which I don't think is a public api.

  • @IonidisIX
    @IonidisIX 4 года назад +2

    Fantastic John. Thank you so much mate.

  • @arabymo
    @arabymo 9 месяцев назад +1

    Wonderful explanation! ❤️

  • @arzigogolato1
    @arzigogolato1 2 года назад

    Great tutorial! I have been fighting with scraping this sort of stuff for a while, you made my work so much easier! Thanks man :)

  • @tomkmb4120
    @tomkmb4120 8 месяцев назад +1

    Great video man, nice job.

  • @ichfan9811
    @ichfan9811 2 года назад +2

    Thanks man, I really enjoyed your content!

  • @lordmo3416
    @lordmo3416 4 года назад

    1:28 the type isn't json for me. It's fetch and when I plug the copied raw text into postman, it throws an importing Curl error to me.
    The page also makes the request automatically every 10 seconds or so; with a different cf-request-id, set-cookie, etag, and without x-media-mis-token in the response header. Sofascore response is all rather perplexing

  • @richtay.7
    @richtay.7 2 года назад +1

    I need to make a Scrapy from a betting site, but it's a casino, I want to make a Scrapy to collect the information from the roulette rounds, and do an analysis on top of that, I just need to get the result data, is it possible? I'm having a hard time getting response from the site, always giving 403 Forbbiden error

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 года назад

      Honestly I don’t tent to touch betting sites, they often have the best bot and scraping protection. If you want to analyse data maybe there is a data set already available that someone else has released ?

    • @richtay.7
      @richtay.7 2 года назад

      @@JohnWatsonRooney Like a similar project? I'm trying to look for some here, the site I want to make Scrapy uses frameworks in Js, I'm trying little by little to get information and apply it to my code, at first I wasn't able to communicate with the site, but I got it, but the information I want is in encoded javascript, so I need to make my code

    • @hammadalamsiddique3730
      @hammadalamsiddique3730 2 года назад

      ​@@richtay.7use selenium

  • @sskinedGUY
    @sskinedGUY Год назад

    What if the website doesn't return json reponse when inspecting in the Network tab, for example bet365, all the response types are 'plain", any advice ?

  • @avexoidavex3577
    @avexoidavex3577 9 месяцев назад

    How can we automate the analysis of the obtained data? Suppose we need to collect several tables and compare data on some columns and rows. Is it possible to launch your own bot for this?

  • @ryanwest8058
    @ryanwest8058 Год назад +1

    This is an Awesome Python Video!!

  • @jacksonmorris6717
    @jacksonmorris6717 2 года назад +1

    hi new to this, I followed all your code I just seem to have an error at import requests. yellow line under requests. do I need to install a package not sure what's happening. thanks

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 года назад

      Hey, sure you should have “pip” installed and can run “pip install requests” in the terminal or command prompt

  • @radgeradge
    @radgeradge 8 месяцев назад

    been trying a bunch of different approaches on this and this one is definitely the simplest! can i just ask (as im a novice), if im looking to rename the column headers would it be best for me to just use the df.rename function?

  • @berdjarafik6283
    @berdjarafik6283 4 года назад +2

    thanks a lot, if u may please make us a video on how to clean datasets once scraped.
    especially, when the data set is messy and not well structured
    (column containing two types of data format; ie : counts & date time).
    thank you very much.

  • @KokeBeast23
    @KokeBeast23 2 года назад

    Is there a reason I don't get the option of 'Code' next to 'Cookies'?

  • @kanglee2377
    @kanglee2377 2 года назад

    Hey I wanted to ask if you could share how to scrape the odds from a betting site/a book maker. I can't get it to work for some reason

  • @terranovatech8672
    @terranovatech8672 3 года назад +1

    My API call was only the first 50 players... How did you manage to pull every player? It's strange, the JSON displays 8100+ players total, but when I export to CSV it only gives me 50....

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад +1

      Is your json response showing all 8k? If so I’d check your loops and export to see if there is an error there?

  • @alejandroramos4926
    @alejandroramos4926 3 года назад

    Hi John, I tried to search for information in a similar way to how you show in the video but on the flashscores site, I don't know about data transmission via json, could you tell me if on that site is the right way?

  • @skylucacius8463
    @skylucacius8463 3 года назад

    How to automate this process ? I.e. How can I get XHR information programatically (from python script)

  • @MatheusSilva-qm3ph
    @MatheusSilva-qm3ph 4 года назад +1

    Very cool the video, congratulations. A question, still to use the "user-data-dir"?
    I'm not getting, could you help you please?

  • @benhall6327
    @benhall6327 3 года назад

    How do you get the api-endpoint commands there? my code says cant find the import "requests" and those api endpoints dont show up in the terminal.

    • @dailyhustlemoti
      @dailyhustlemoti 11 месяцев назад

      You need to install the requests package. Type pip install requests into your vs terminal

  • @Cedric_0
    @Cedric_0 4 года назад +1

    Good video, well explained, but I am stuck at gziped csv response how can I get that csv in python, thanks in advance

  • @KokeBeast23
    @KokeBeast23 2 года назад

    I don’t get the option to copy as Curl (windows) only (cmd) or (bash) :((

    • @KokeBeast23
      @KokeBeast23 2 года назад

      Using Firefox instead of Microsoft SE fixed this

  • @rakeshchaudhary1525
    @rakeshchaudhary1525 3 года назад +2

    Hi John- I have been following your awesome scrapy and webscraping videos. Can you create a video that explains how to build and then deploy large scale web scrapers ?
    For example: in this case, how to call API for multiple pages ? Considering the video time and API call limits, Even if you show 2 automated iterations, that would be great.

  • @kwamstercmg8968
    @kwamstercmg8968 Год назад

    what do I do when there is no api to scrape ?

  • @brianschroeder2465
    @brianschroeder2465 4 года назад +2

    Thanks for the video! Question is this token going to expire eventually that is used in the request?

    • @JohnWatsonRooney
      @JohnWatsonRooney  4 года назад +1

      Yes it will - this sort of scraping is more of a on off get the data and run type rather than something that can be run daily or weekly easily

    • @brianschroeder2465
      @brianschroeder2465 4 года назад +1

      @@JohnWatsonRooney Cool, thanks for the info and inspiration. I was able to get what I needed with a library and an api. Here's my repo, still have alot of tuning to do any recommendations would be appreciated!: github.com/brianschroeder/NBAGamePredictor/blob/main/NbaGamePredictor.py

    • @JohnWatsonRooney
      @JohnWatsonRooney  4 года назад +1

      That’s a great project idea Brian - I’ll definitely going to check out your repo!

  • @yajantbhawsar2481
    @yajantbhawsar2481 4 года назад +1

    Hello john , could you please make a video on "desktop scrapping"?

  • @PredatorsUltimateSoccerChannel
    @PredatorsUltimateSoccerChannel 2 года назад

    I’m having a tough time finding a way to do this using C++(i don’t know whether its even possible).If anyone knows how please leave a link with an explanation down below. Thank you in advance

  • @zhaofour9833
    @zhaofour9833 2 года назад

    This is absolutely fantastic Sir. I wonder if I wanna get the live data, such as live odds and live score, can I still use this method?

  • @abhinavshah138
    @abhinavshah138 4 года назад +2

    Hey John, can you scrap Walmart (title & price) using bs4?
    Would love a video on that! Keep up the good work ❤️👌🏻

  • @yurimolfarUA
    @yurimolfarUA 2 года назад

    Hello! Nice explanation, but I have a question. Could you give me any tips on how to get "scraped" a numeric odds for specific page in live? Say, get 3 values from 1 page every 20 seconds. Maybe there are already some tools exist. I am a newbie in programming. With respect, Ivan

  • @kimbanzip
    @kimbanzip 4 года назад +1

    Thanks ! Great explanation.

  • @susanwowe7810
    @susanwowe7810 2 года назад

    Really a great tutorial. First time to know the code tab in postman and the pd.json_normalize() method. Thumbs up 👍

  • @engineerbaaniya4846
    @engineerbaaniya4846 4 года назад +4

    You have rocked

  • @profoundgenius9726
    @profoundgenius9726 3 года назад +1

    Just dropped a 💎!! Subbed

  • @ugurdev
    @ugurdev 3 года назад

    Thanks John, I have done the same process for NBA but unfortunately the code Insomnia generates does not work.

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад

      I haven’t checked that specifically but it’s possible they have better detection for this method

    • @ugurdev
      @ugurdev 3 года назад

      @@JohnWatsonRooney I figured it out eventually, it is just insomnia not generating the correct code or sometimes their output has broken code. (For example double quotes inside double quotes breaking the string format) Ran into this on 2 more cases. Can work around this with copying request headers from the dev tool though.

    • @cuccuu1730
      @cuccuu1730 3 года назад

      @Ugur Did you find the stats files on the official NBA website? Because I can't find which file I need...

  • @BathingAfrican
    @BathingAfrican 2 года назад +1

    man i love this channel idek how i found it

  • @abiodunogunnaike2688
    @abiodunogunnaike2688 4 года назад +1

    God bless you bro, you just read my mind. i think you are using firefox, what extention did u use to preview the response? i mean the red box

    • @JohnWatsonRooney
      @JohnWatsonRooney  4 года назад

      Thanks! Yes I am using Firefox- no extensions though the response is shown in the inspect element tool by clicking on the get request

  • @yusufrumi1626
    @yusufrumi1626 4 года назад +1

    You are a gem

  • @meedip07
    @meedip07 Год назад

    thanks and awesome. Kudos!!

  • @lifeofreggiewoods
    @lifeofreggiewoods 2 года назад

    Cool, now how do I implement these stats to my html website?

  • @zholl005
    @zholl005 2 года назад +1

    you should check out thunder client extension in vs code. Got me to uninstall postman

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 года назад

      Yeah I've heard of that, I should look into it more. I like to keep my API program separate though I guess its just what I'm used to

  • @tariqanwar8097
    @tariqanwar8097 4 года назад +2

    great video

  • @coldfya6739
    @coldfya6739 4 года назад +2

    u saved my life

  • @KhalilYasser
    @KhalilYasser 4 года назад

    Thanks a lot. You are a rock.
    Can you share the code please?

  • @eu.pedroleon
    @eu.pedroleon 4 года назад

    Thanks a lot

  • @vanderleimanoeldias1988
    @vanderleimanoeldias1988 2 года назад

    manda o code pa nois

  • @binhole
    @binhole Год назад

    how get scrapping bac bo - Evoluting gaming

  • @NoTengoIdeaGuey
    @NoTengoIdeaGuey 3 года назад +4

    Easiest way to scrape data: don't scrape the data.

  • @bluiish999
    @bluiish999 11 месяцев назад

    poor explanation

  • @joilsongb436
    @joilsongb436 3 года назад

    can you do this method on the page
    b e t 3 6 5 ?
    I couldn't with the instruction in this video
    Delete the spaces between the words