问题描述
所以我在灯塔上测试了我的网站,但出现此错误,有人知道如何修复它
erro:链接不可抓取
<a class="floating-header-share-tw" aria-label="Twitter" href="https://twitter.com/share?text=5%20%d8%a3%d9%85%d9%88%d8%b1%20%d8%aa%d8%ac…" onclick="window.open(this.href,'share-twitter','width=550,height=235');return false;">
Linkedin
<a class="floating-header-share-in" aria-label="Linkedin" href="https://www.linkedin.com/shareArticle?mini=5%20%d8%a3%d9%85%d9%88%d8%b1%20…" onclick="window.open(this.href,'share-facebook','width=580,height=296');return fals…">
Facebook
<a class="floating-header-share-fb" aria-label="Facebook" href="https://www.facebook.com/sharer/sharer.PHP?u=https%3a%2f%2fmoFeed.netlify.…" onclick="window.open(this.href,height=296');return fals…">
解决方法
那是因为您要用previously answered here将return false
的链接的本机功能禁用。
另外:
- 您可能仍然不希望这些链接被爬网,因此您应该考虑添加
rel=nofollow
- 当您的链接具有可见的锚文本时,应删除aria-label属性,这只会增加噪音,可能会导致听得见aria标签和链接文本的屏幕阅读器用户感到烦恼。