modify scripts

This commit is contained in:
oscarz
2025-03-30 10:31:17 +08:00
parent 60b4a6ae4a
commit 10681feb09
2 changed files with 6 additions and 3 deletions

View File

@ -165,7 +165,7 @@ def fetch_performers_detail():
all_movies = [] all_movies = []
while next_url: while next_url:
logging.info(f"Fetching data for actor ({person}), url {next_url} ...") logging.info(f"Fetching data for actor ({person}), url {next_url} ...")
soup, status_code = scraper.fetch_page(next_url, partial(scraper.generic_validator, tag="div", identifier="movie-list h cols-4 vcols-5", attr_type="class")) soup, status_code = scraper.fetch_page(next_url, partial(scraper.generic_validator, tag="span", identifier="actor-section-name", attr_type="class"))
if soup: if soup:
data, next_url = scraper.parse_actor_detail(soup, next_url) data, next_url = scraper.parse_actor_detail(soup, next_url)
if data: if data:

View File

@ -167,7 +167,10 @@ def parse_actor_detail(soup, href):
# 返回数据 # 返回数据
actor = {} actor = {}
div_movies = soup.find("div", class_='movie-list h cols-4 vcols-5') # 使用正则表达式查找 class 包含 'movie-list h cols-4' 的 div 元素
div_movies = soup.find("div", class_=re.compile(r'movie-list h cols-'))
#div_movies = soup.find("div", class_='movie-list h cols-4 vcols-5')
#div_movies = soup.find("div", class_='movie-list h cols-4 vcols-8')
if not div_movies: if not div_movies:
logging.warning(f"Warning: No movies div found ") logging.warning(f"Warning: No movies div found ")
return None, None return None, None