Skip to content

Commit 3c58afe

Browse files
committed
change the way we find the table of contents table
1 parent 0d95161 commit 3c58afe

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

session.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,14 @@ def get_metadata(self, meeting_id):
173173
return meeting
174174

175175
def get_toc(self, session_id):
176-
url = urljoin(self.base_url, "sitzungen_top.php")
177-
site_content = requests.get(url, params={"sid": session_id}).text
178-
soup = BeautifulSoup(site_content)
179-
180-
for table in soup.find_all('table'):
181-
tr = int(len(table.find_all('tr')))
182-
td = int(len(table.find_all('td')))
183-
if td > 9 * tr:
184-
tops = self.parse_table(table)
185-
for top in self.parse_toc(session_id, tops):
186-
yield top
176+
url = urljoin(self.base_url, 'sitzungen_top.php')
177+
html = requests.get(url, params={"sid": session_id}).text
178+
soup = BeautifulSoup(html)
179+
180+
table = soup.find('div', {'id': 'ajax_sitzungsmappe'}).table
181+
toc = self.parse_table(table)
182+
for entry in self.parse_toc(session_id, toc):
183+
yield entry
187184

188185
def parse_table(self, table):
189186
values = []

0 commit comments

Comments
 (0)