@@ -42,26 +42,26 @@ def parse_search_results(html: str) -> list[SearchResult]:
4242 return results
4343
4444 # Find the next table after the header
45- table : Tag | None = search_header .find_next ("table" , class_ = "gray" ) # type: ignore[assignment]
45+ table : Tag | None = search_header .find_next ("table" , class_ = "gray" )
4646 if not table :
4747 logger .debug ("No search results table found" )
4848 return results
4949
5050 # Skip header row, process data rows
51- rows : list [Tag ] = table .find_all ("tr" )[1 :] # type: ignore[assignment]
51+ rows : list [Tag ] = table .find_all ("tr" )[1 :]
5252 logger .debug (f"Found { len (rows )} result rows to process" )
5353
5454 for row in rows :
55- cells : list [Tag ] = row .find_all ("td" ) # type: ignore[assignment]
55+ cells : list [Tag ] = row .find_all ("td" )
5656 if len (cells ) < 5 : # Need at least: Type, Name, Location, Range, Elevation
5757 continue
5858
5959 # Extract peak link (2nd column)
60- link : Tag | None = cells [1 ].find ("a" , href = lambda x : x and "peak.aspx?pid=" in x ) # type: ignore[assignment]
60+ link : Tag | None = cells [1 ].find ("a" , href = lambda x : x and "peak.aspx?pid=" in x )
6161 if not link :
6262 continue
6363
64- href : str = link ["href" ] # type: ignore[assignment]
64+ href : str = link ["href" ]
6565 name : str = link .get_text (strip = True )
6666
6767 # Extract peak ID from URL
@@ -126,7 +126,7 @@ def parse_peak_detail(html: str, pid: str) -> Peak | None:
126126
127127 try :
128128 # Extract peak name and state from H1
129- h1 : Tag | None = soup .find ("h1" ) # type: ignore[assignment]
129+ h1 : Tag | None = soup .find ("h1" )
130130 if not h1 :
131131 logger .debug ("No H1 tag found in peak detail page" )
132132 return None
@@ -143,7 +143,7 @@ def parse_peak_detail(html: str, pid: str) -> Peak | None:
143143 peak : Peak = Peak (pid = pid , name = name , state = state )
144144
145145 # Extract elevation from H2
146- h2 : Tag | None = soup .find ("h2" ) # type: ignore[assignment]
146+ h2 : Tag | None = soup .find ("h2" )
147147 if h2 :
148148 elevation_text : str = h2 .get_text (strip = True )
149149 # Format: "Elevation: 10,984 feet, 3348 meters"
@@ -310,7 +310,7 @@ def parse_peak_ascents(html: str) -> list[Ascent]:
310310 ascents : list [Ascent ] = []
311311
312312 # Find all tables
313- tables : list [Tag ] = soup .find_all ("table" ) # type: ignore[assignment]
313+ tables : list [Tag ] = soup .find_all ("table" )
314314 logger .debug (f"Found { len (tables )} tables in HTML" )
315315
316316 # Look for the data table with dynamic header detection
@@ -319,14 +319,14 @@ def parse_peak_ascents(html: str) -> list[Ascent]:
319319 num_columns : int = 0
320320
321321 for table in tables :
322- rows : list [Tag ] = table .find_all ("tr" ) # type: ignore[assignment]
322+ rows : list [Tag ] = table .find_all ("tr" )
323323 if len (rows ) < 10 :
324324 continue
325325
326326 # Check if second row has expected headers
327327 if len (rows ) > 1 :
328328 header_row : Tag = rows [1 ]
329- headers : list [Tag ] = header_row .find_all (["th" , "td" ], recursive = False ) # type: ignore[assignment]
329+ headers : list [Tag ] = header_row .find_all (["th" , "td" ], recursive = False )
330330
331331 # Table must have reasonable number of columns (not the merged giant table)
332332 if len (headers ) < 3 or len (headers ) > 20 :
@@ -368,7 +368,7 @@ def parse_peak_ascents(html: str) -> list[Ascent]:
368368 # Process data rows (skip first 2 rows: separator and header)
369369 for row in rows [2 :]:
370370 # Use recursive=False to avoid counting cells in nested tables (e.g., route icons)
371- cells : list [Tag ] = row .find_all (["td" , "th" ], recursive = False ) # type: ignore[assignment]
371+ cells : list [Tag ] = row .find_all (["td" , "th" ], recursive = False )
372372
373373 # Skip rows that don't match the expected column count
374374 if len (cells ) != num_columns :
@@ -378,7 +378,7 @@ def parse_peak_ascents(html: str) -> list[Ascent]:
378378 climber_cell : Tag = cells [climber_idx ]
379379 climber_link : Tag | None = climber_cell .find (
380380 "a" , href = lambda x : x and "climber.aspx?cid=" in x
381- ) # type: ignore[assignment]
381+ )
382382 if not climber_link :
383383 continue
384384
@@ -391,7 +391,7 @@ def parse_peak_ascents(html: str) -> list[Ascent]:
391391 date_cell : Tag = cells [date_idx ]
392392 date_link : Tag | None = date_cell .find (
393393 "a" , href = lambda x : x and "ascent.aspx?aid=" in x
394- ) # type: ignore[assignment]
394+ )
395395 if not date_link :
396396 continue
397397
@@ -415,7 +415,7 @@ def parse_peak_ascents(html: str) -> list[Ascent]:
415415 has_gpx : bool = False
416416 if gps_idx != - 1 :
417417 gps_cell : Tag = cells [gps_idx ]
418- gps_img : Tag | None = gps_cell .find ("img" , src = lambda x : x and "GPS.gif" in x ) # type: ignore[assignment]
418+ gps_img : Tag | None = gps_cell .find ("img" , src = lambda x : x and "GPS.gif" in x )
419419 has_gpx = gps_img is not None
420420
421421 # Check for trip report (optional column)
@@ -470,7 +470,7 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
470470
471471 try :
472472 # Extract title: "Ascent of [Peak Name] on [Date]" or "Ascent of [Peak Name] in [Year]"
473- h1 : Tag | None = soup .find ("h1" ) # type: ignore[assignment]
473+ h1 : Tag | None = soup .find ("h1" )
474474 if not h1 :
475475 logger .debug ("No H1 tag found in ascent detail page" )
476476 return None
@@ -486,13 +486,13 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
486486 peak_name = parts [0 ].replace ("Ascent of " , "" ).strip ()
487487
488488 # Extract climber from H2: "Climber: [Name]"
489- h2 : Tag | None = soup .find ("h2" ) # type: ignore[assignment]
489+ h2 : Tag | None = soup .find ("h2" )
490490 climber_name : str | None = None
491491 climber_id : str | None = None
492492 if h2 :
493493 climber_link : Tag | None = h2 .find (
494494 "a" , href = lambda x : x and "climber.aspx?cid=" in x
495- ) # type: ignore[assignment]
495+ )
496496 if climber_link :
497497 climber_name = climber_link .get_text (strip = True )
498498 climber_href : str = climber_link ["href" ] # type: ignore[assignment]
@@ -506,7 +506,7 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
506506 # Find the left gray table (width="49%", align="left")
507507 table : Tag | None = soup .find (
508508 "table" , class_ = "gray" , attrs = {"width" : "49%" , "align" : "left" }
509- ) # type: ignore[assignment]
509+ )
510510 if not table :
511511 return None
512512
@@ -519,9 +519,9 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
519519 )
520520
521521 # Extract data from table rows
522- rows : list [Tag ] = table .find_all ("tr" ) # type: ignore[assignment]
522+ rows : list [Tag ] = table .find_all ("tr" )
523523 for row in rows :
524- cells : list [Tag ] = row .find_all ("td" , recursive = False ) # type: ignore[assignment]
524+ cells : list [Tag ] = row .find_all ("td" , recursive = False )
525525 if len (cells ) < 1 :
526526 continue
527527
@@ -551,9 +551,9 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
551551 ascent .trip_report_text = report_text .strip ()
552552
553553 # Extract external URL if present
554- url_link : Tag | None = cells [0 ].find ("a" , href = re .compile (r"^https?://" )) # type: ignore[assignment]
554+ url_link : Tag | None = cells [0 ].find ("a" , href = re .compile (r"^https?://" ))
555555 if url_link and url_link .get ("href" ):
556- href = url_link ["href" ] # type: ignore[assignment]
556+ href = str ( url_link ["href" ])
557557 # Only store if not peakbagger.com
558558 if "peakbagger.com" not in href :
559559 ascent .trip_report_url = href
@@ -565,7 +565,7 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
565565 # Get label from first cell
566566 # Some labels have <b> tags, others are just text
567567 label_cell = cells [0 ]
568- label_b : Tag | None = label_cell .find ("b" ) # type: ignore[assignment]
568+ label_b : Tag | None = label_cell .find ("b" )
569569 if label_b :
570570 label : str = label_b .get_text (strip = True ).rstrip (":" )
571571 else :
@@ -616,7 +616,7 @@ def parse_ascent_detail(html: str, ascent_id: str) -> Ascent | None:
616616 # Extract peak link and ID
617617 peak_link : Tag | None = value_cell .find (
618618 "a" , href = lambda x : x and "peak.aspx?pid=" in x
619- ) # type: ignore[assignment]
619+ )
620620 if peak_link :
621621 ascent .peak_name = peak_link .get_text (strip = True )
622622 peak_href : str = peak_link ["href" ] # type: ignore[assignment]
0 commit comments