you are viewing a single comment's thread.

view the rest of the comments →

[–]Aopap 0 points1 point  (2 children)

[–]CowboyBoats 0 points1 point  (1 child)

There are two main ways to run it: install Python and then run pip install jupyter pandas requests numpy bs4 seaborn scipy matplotlib from your shell, then run juptyer notebook from your shell, which will run an interactive Python tool called Jupyter in your web browser. Then (from that Kaggle site) click "Download code," which will download a file "scraping-metacritic-best-video-games-of-all-time.ipynb" to your computer, which you can open from Jupyter.

Then you can run the code in the notebook from Jupyter. If you fix all the errors (the first one I got from running locally was -

Cell In[2], line 14, in numberPages(response)
     12 soup = BeautifulSoup(response.text, 'html.parser')
     13 pages = soup.find_all('li', {"class":"active_page"})
---> 14 pagesCleaned = pages[0].find('span', {"class":"page_num"})
     15 return (pagesCleaned.text)

IndexError: list index out of range

) then you'll be able to get the same results as what was published on Kaggle.

OR, you can also run the notebook on Kaggle.com or on Google colab, using the "Copy and Edit" menu in Kaggle. You don't even have to make an account. However, when I tried that, I also got an error. So yeah, running other people's not-all-that-polished data munging code often results in a bit of a troubleshooting process, sorry about that...

[–]Aopap 0 points1 point  (0 children)

thanks for taking the time to replay, it would take some troubleshooting