| 64 |
|
target_page_name_human = target_page_name.replace('_', ' ') |
| 65 |
|
if debug: pywikibot.stdout(' Searching for section link {} on page.'.format(anchor_name)) |
| 66 |
|
|
| 67 |
– |
# Convert slash character to the dot-notation hex encoding that MediaWiki uses |
| 68 |
– |
anchor_name = anchor_name.replace('/', '.2F') |
| 69 |
– |
|
| 67 |
|
# Read linked page to see if it really has this anchor link |
| 68 |
|
soup = BeautifulSoup(page_text, 'html.parser') |
| 69 |
|
found_section = False |
| 83 |
|
break |
| 84 |
|
if found_section == False: |
| 85 |
|
possibly_print(page_name) |
| 86 |
< |
pywikibot.stdout(' ERROR: Could not find section "{0}" on page {1}!'.format(anchor_name, pre_section)) |
| 86 |
> |
pywikibot.stdout(' ERROR: Could not find section "{0}" on page {1}!'.format(anchor_name, target_page_name_human)) |
| 87 |
|
errors_issued += 1 |
| 88 |
|
elif debug and print_result: |
| 89 |
|
pywikibot.stdout(' The section "{0}" was found on page "{1}".'.format(anchor_name, target_page_name_human)) |