From 4d5f9521efaf68a5080f9e38ed9b5b1758042399 Mon Sep 17 00:00:00 2001 From: oscar Date: Sun, 9 Mar 2025 16:52:32 +0800 Subject: [PATCH] modify some scripts. --- scripts/iafd/src/iafd_scraper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/iafd/src/iafd_scraper.py b/scripts/iafd/src/iafd_scraper.py index aafaed5..b4a2de8 100644 --- a/scripts/iafd/src/iafd_scraper.py +++ b/scripts/iafd/src/iafd_scraper.py @@ -298,6 +298,8 @@ def parse_credits_table(table, distributor_list): # rows = table.find_all('tr', class_='we') for row in rows: + #tr_class = row.get('class', '') # 获取 class 属性,如果没有则返回空字符串 + tr_class = ' '.join(row.get('class', [])) # 获取 class 属性,如果没有则返回空字符串 cols = row.find_all('td') if len(cols) >= 6: title = cols[0].text.strip() @@ -305,6 +307,8 @@ def parse_credits_table(table, distributor_list): href = href_a['href'] if href_a else '' year = cols[1].text.strip() distributor = cols[2].text.strip().lower() + href_d = cols[2].find('a') + href_dist = host_url + href_d['href'] if href_d else '' notes = cols[3].text.strip() rev = cols[4].text.strip() formats = cols[5].text.strip() @@ -318,9 +322,11 @@ def parse_credits_table(table, distributor_list): 'href' : href, 'year': year, 'distributor': distributor, + 'distributor_href': href_dist, 'notes': notes, 'rev': rev, - 'formats': formats + 'formats': formats, + 'tr_class': tr_class }) return movies, distributor_count