Last active
April 22, 2021 23:23
-
-
Save thepycoach/dce27bb60b85c81daa96d7b3d288d99b 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
| # update 3 (commented code not necesssary anymore) | |
| # for sport in sport_title: | |
| # selecting only football | |
| # if sport.text == 'Football': | |
| parent = sport_title.find_element_by_xpath('./..') #immediate parent node | |
| # update 4 (+3 times .find_element_by_xpath('./..')) | |
| grandparent = parent.find_element_by_xpath('./..').find_element_by_xpath('./..').find_element_by_xpath('./..').find_element_by_xpath('./..') | |
| #3. empty groups | |
| try: | |
| empty_groups = grandparent.find_elements_by_class_name('EventOddGroup-styles-empty-group') | |
| empty_events = [empty_group.find_element_by_xpath('./..') for empty_group in empty_groups[:]] | |
| except: | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment