Starchik1 commited on
Commit
8b4a401
·
verified ·
1 Parent(s): 5056b03

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -5
main.py CHANGED
@@ -168,13 +168,20 @@ def proxy(path):
168
 
169
  current_span = None
170
  for link in nav_links:
171
- if '>' not in link.string and link.parent.name != 'td':
172
- if current_span is None:
173
- current_span = soup.new_tag('span')
174
- breadcrumb_div.append(current_span)
175
- current_span.append(link)
 
 
 
 
176
  current_span = soup.new_tag('span')
177
  breadcrumb_div.append(current_span)
 
 
 
178
 
179
  # Replace old navigation with new breadcrumb
180
  first_hr = soup.find('hr')
 
168
 
169
  current_span = None
170
  for link in nav_links:
171
+ # Skip links without text content or those in table cells
172
+ if not link.string or link.parent.name == 'td':
173
+ continue
174
+
175
+ # Skip navigation arrows
176
+ if '>' in link.string:
177
+ continue
178
+
179
+ if current_span is None:
180
  current_span = soup.new_tag('span')
181
  breadcrumb_div.append(current_span)
182
+ current_span.append(link)
183
+ current_span = soup.new_tag('span')
184
+ breadcrumb_div.append(current_span)
185
 
186
  # Replace old navigation with new breadcrumb
187
  first_hr = soup.find('hr')