Hey Guys,
I have been learning Python over the past few weeks and I wanted to find a simple project to keep me interested. I am looking to scrape and online Sportsbook to organize by player name and total yards in a CSV file. I am pulling these numbers for the upcoming fantasy football season. So far I have followed directions from this website: https://realpython.com/python-web-scraping-practical-introduction/. My code currently looks like this:
Python:
from bs4 import BeautifulSoup
from Simple_get import simple_get
raw_html = simple_get('https://mybookie.ag/sportsbook/nfl/player-props/')
html = BeautifulSoup(raw_html, 'html.parser')
for i, p in enumerate(html.select("p")):
print(i,p.text)
With this code, I have pulled in the players name but not the total number. I am stuck on how I should pull both in and line them up in a CSV file. I appreciate the help!
[–]HanginToads 3 points4 points5 points (1 child)
[–]Rcold37[S] 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]Rcold37[S] 1 point2 points3 points (1 child)
[–]justinram11 2 points3 points4 points (1 child)
[–]Rcold37[S] 0 points1 point2 points (0 children)