Archived
1
0
Fork 0

Update getinfobox.py

This commit is contained in:
yzhh 2022-08-03 17:23:27 +08:00
parent 89f510760c
commit fe53ca1fd7

View file

@ -177,13 +177,17 @@ async def get_pic(link, page_link, headers, section=None, allow_special_page=Fal
element.extract()
selected = False
x = None
for x in soup.find_all('h2'):
for y in x.find_all('span', id=section):
if y != '':
selected = True
break
hx = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
for h in hx:
if selected:
break
for x in soup.find_all(h):
for y in x.find_all('span', id=section):
if y != '':
selected = True
break
if selected:
break
if not selected:
Logger.info('Found nothing...')
return False