Changeset 1191
- Timestamp:
- Jul 7, 2024, 12:01:44 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ValBot/Python/check_interwiki_links.py
r1185 r1191 63 63 soup = BeautifulSoup(page_text, 'html.parser') 64 64 found_section = False 65 for span_tag in soup.findAll('span'): # search for span with ID matching the section name66 span_name = span_tag.get('id', None)67 if span_name == anchor_name:65 for the_tag in soup.findAll('span'): # search for span with ID matching the section name 66 tag_name = the_tag.get('id', None) 67 if tag_name == anchor_name: 68 68 found_section = True 69 69 break 70 70 if found_section == False: 71 for span_tag in soup.findAll('div'): # search for div with ID matching the section name 72 span_name = span_tag.get('id', None) 73 if span_name == anchor_name: 71 for the_tag in soup.findAll('div'): # search for div with ID matching the section name 72 tag_name = the_tag.get('id', None) 73 if tag_name == anchor_name: 74 found_section = True 75 break 76 if found_section == False: 77 for the_tag in soup.findAll('h2'): # search for h2 with ID matching the section name 78 tag_name = the_tag.get('id', None) 79 if tag_name == anchor_name: 80 found_section = True 81 break 82 if found_section == False: 83 for the_tag in soup.findAll('h3'): # search for h3 with ID matching the section name 84 tag_name = the_tag.get('id', None) 85 if tag_name == anchor_name: 86 found_section = True 87 break 88 if found_section == False: 89 for the_tag in soup.findAll('h4'): # search for h4 with ID matching the section name 90 tag_name = the_tag.get('id', None) 91 if tag_name == anchor_name: 74 92 found_section = True 75 93 break
Note:
See TracChangeset
for help on using the changeset viewer.