Fix link tag with missing rel attribute
This commit is contained in:
parent
e843abbc41
commit
3b6df3417a
@ -92,7 +92,7 @@ def process_url(url: str, dup_check: bool = False):
|
|||||||
|
|
||||||
for link_tag in soup.find_all('link'):
|
for link_tag in soup.find_all('link'):
|
||||||
link_url = complete_url(link_tag['href'], base_url=url)
|
link_url = complete_url(link_tag['href'], base_url=url)
|
||||||
if 'stylesheet' in link_tag['rel']:
|
if link_tag.get('rel') and 'stylesheet' in link_tag['rel']:
|
||||||
print('New CSS: %s' % link_url)
|
print('New CSS: %s' % link_url)
|
||||||
css_tag = soup.new_tag('style', media='screen', type='text/css')
|
css_tag = soup.new_tag('style', media='screen', type='text/css')
|
||||||
css_tag.string = get_text(link_url)
|
css_tag.string = get_text(link_url)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user