small changes
This commit is contained in:
@@ -52,7 +52,6 @@ def extract_movie_info(file_path):
|
|||||||
directed_by = data.get_text(" ", strip=True)
|
directed_by = data.get_text(" ", strip=True)
|
||||||
|
|
||||||
elif header_text == "Starring":
|
elif header_text == "Starring":
|
||||||
# Get cast members split by <br> or links/text
|
|
||||||
cast_items = list(data.stripped_strings)
|
cast_items = list(data.stripped_strings)
|
||||||
cast = cast_items[:5]
|
cast = cast_items[:5]
|
||||||
|
|
||||||
@@ -64,11 +63,9 @@ def extract_movie_info(file_path):
|
|||||||
plot_header = soup.find(id="Plot")
|
plot_header = soup.find(id="Plot")
|
||||||
|
|
||||||
if plot_header:
|
if plot_header:
|
||||||
# Move to the parent heading container if needed
|
|
||||||
current = plot_header.parent
|
current = plot_header.parent
|
||||||
|
|
||||||
for sibling in current.find_next_siblings():
|
for sibling in current.find_next_siblings():
|
||||||
# Stop when next h2 section begins
|
|
||||||
if sibling.name == "div" and "mw-heading2" in sibling.get("class", []):
|
if sibling.name == "div" and "mw-heading2" in sibling.get("class", []):
|
||||||
break
|
break
|
||||||
if sibling.name == "p":
|
if sibling.name == "p":
|
||||||
|
|||||||
Reference in New Issue
Block a user