fixed crashing when finding tables that do not contain links in the

columns
This commit is contained in:
Johannes Erwerle 2022-04-01 12:04:54 +02:00
parent 4742e417f7
commit 544e609d44

View file

@ -153,8 +153,12 @@ class CrawlObject():
if len(items) == 4:
_, name, _, download = items
link = download.find("a").attrs["href"]
name = name.find("a").text + ".mp4" # rough estimate that all files are mp4
link_element = download.find("a")
name_element = name.find("a")
if link_element is not None and name_element is not None:
link = link_element.attrs["href"]
name = name_element.text + ".mp4" # rough estimate that all files are mp4
url = urljoin(self.url, link)
path = self.path / name