mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 15:35:05 +02:00
Fix some typing errors
It seems like the type hints have gotten better :)
This commit is contained in:
parent
5646e933fd
commit
ebcfb2a2f3
10 changed files with 51 additions and 71 deletions
|
|
@ -3,7 +3,7 @@ import http.cookies
|
|||
import ssl
|
||||
from datetime import datetime
|
||||
from pathlib import Path, PurePath
|
||||
from typing import Any, Optional, cast
|
||||
from typing import Any, Optional
|
||||
|
||||
import aiohttp
|
||||
import certifi
|
||||
|
|
@ -187,7 +187,7 @@ class HttpCrawler(Crawler):
|
|||
if level == 0 or (level == 1 and drop_h1):
|
||||
return PurePath()
|
||||
|
||||
level_heading = cast(Optional[Tag], tag.find_previous(name=f"h{level}"))
|
||||
level_heading = tag.find_previous(name=f"h{level}")
|
||||
|
||||
if level_heading is None:
|
||||
return find_associated_headings(tag, level - 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue