I am running this code:
TMQuery().search_competition("Premier League").get_clubs("2023-24").csv()
And getting this error message:
ValueError Traceback (most recent call last)
Cell In[3], line 1
----> 1 a1 = TMQuery().search_competition("Premier League").get_clubs("2023-24").csv()
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\query\tables.py:60, in ClubTable.csv(self, season)
59 def csv(self, season: str = None) -> str:
---> 60 tmp_data = "\n".join([str(x) for x in self.data(season)])
61 return ClubData.csv_header() + "\n" + tmp_data
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\query\tables.py:57, in ClubTable.data(self, season)
56 def data(self, season: str = None) -> 'List[ClubData]':
---> 57 return [club.get_data(season) for club in self._data]
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\spiders\club.py:132, in ClubInstance.get_data(self, season)
130 def get_data(self, season: str = None) -> ClubData:
131 if not self._data:
--> 132 self._scrape(season)
133 return self._data
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\spiders\club.py:65, in ClubInstance.scrape(self, season)
62 info = soup.find_all(class="data-header__content")
64 if len(info) == 9:
---> 65 table_position = int(info[1].find("a").get_text().strip())
66 else:
67 table_position = None
ValueError: invalid literal for int() with base 10: ''
I am running this code:
TMQuery().search_competition("Premier League").get_clubs("2023-24").csv()And getting this error message:
ValueError Traceback (most recent call last)
Cell In[3], line 1
----> 1 a1 = TMQuery().search_competition("Premier League").get_clubs("2023-24").csv()
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\query\tables.py:60, in ClubTable.csv(self, season)
59 def csv(self, season: str = None) -> str:
---> 60 tmp_data = "\n".join([str(x) for x in self.data(season)])
61 return ClubData.csv_header() + "\n" + tmp_data
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\query\tables.py:57, in ClubTable.data(self, season)
56 def data(self, season: str = None) -> 'List[ClubData]':
---> 57 return [club.get_data(season) for club in self._data]
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\spiders\club.py:132, in ClubInstance.get_data(self, season)
130 def get_data(self, season: str = None) -> ClubData:
131 if not self._data:
--> 132 self._scrape(season)
133 return self._data
File ~\AppData\Roaming\Python\Python312\site-packages\tmquery\spiders\club.py:65, in ClubInstance.scrape(self, season)
62 info = soup.find_all(class="data-header__content")
64 if len(info) == 9:
---> 65 table_position = int(info[1].find("a").get_text().strip())
66 else:
67 table_position = None
ValueError: invalid literal for int() with base 10: ''