Last active
April 22, 2021 23:05
-
-
Save thepycoach/2b6aee4e0895f3a00ca59ee4ebefff6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Getting data | |
| for match in single_row_events: | |
| #'odd_events' | |
| odds_event = match.find_elements_by_class_name('EventOddGroup-styles-odd-groups') | |
| odds_events.append(odds_event) | |
| # Team names | |
| for team in match.find_elements_by_class_name('EventTeams-styles-titles'): | |
| teams.append(team.text) | |
| #Getting data: the odds | |
| for odds_event in odds_events: | |
| for n, box in enumerate(odds_event): | |
| rows = box.find_elements_by_xpath('.//*') | |
| if n == 0: | |
| x12.append(rows[0].text) | |
| #5 over/under + goal line | |
| if n == 1: | |
| parent = box.find_element_by_xpath('./..') | |
| goals = parent.find_element_by_class_name('EventOddGroup-styles-fixed-param-text').text | |
| over_under.append(goals+'\n'+rows[0].text) | |
| #6 both teams to score | |
| if n == 2: | |
| btts.append(rows[0].text) | |
| driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment