Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmaloney committed Aug 4, 2019
1 parent 15b871d commit daabddb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scraper.py
Expand Up @@ -7,8 +7,6 @@
import datetime
import sqlite3
import time
import os


all_links = []
location = []
Expand All @@ -18,6 +16,9 @@
f1 = []
f2 = []




def scrape_data():

data = requests.get("http://ufcstats.com/statistics/events/upcoming")
Expand All @@ -38,11 +39,12 @@ def scrape_data():
h2 = soup.find("h2")
e_name.append(h2.text)

box_item = soup.find("b-list__box-list-item")
box_item = soup.find('ul',{'class': '"b-list__box-list-item"})
box_item = box_item.find_all('li')

place = box_item.text.strip("Location:").strip()
place = box_item[0].text.strip("Location:").strip()
place.append(location)
d = box_item.text.strip("Date:").strip()
d = box_item[1].text.strip("Date:").strip()
d.append(date)

rows = soup.find_all('table', {"class": "b-fight-details__table b-fight-details__table_style_margin-top b-fight-details__table_type_event-details js-fight-table"})
Expand Down

0 comments on commit daabddb

Please sign in to comment.