2012-11-19 69 views
0

Facebook可以(幾乎)總是從頁面中提取最重要的文本內容和圖像。我認爲一個常用的解析規則不能做到這一點。Facebook如何實現附加鏈接

Facebook如何實現它? 它是否準備瞭解析熱門網站鏈接的規則? 或者有更聰明的方法來查找HTML的真實內容?

回答

0

Meta標籤。許多網站甚至會使用開放圖og<meta>標籤對facebook進行優化。即使是那些不使用og往往有<meta>標籤與像摘要有用的信息,標題,圖像等

https://developers.facebook.com/docs/opengraph/keyconcepts/

因此,要回答你的問題 - 他們不這樣做。網站爲他們做。

+0

據我所知,有些信息可能從標題中獲得。我認爲這是大多數網站的合理解決方案。然而,FB,鏈接,谷歌+他們做得比這更好。讓我們來看看LinkedIn,並附上SO's About頁面,(http://stackoverflow.com/about)您可以看到,它提取了最重要的文本和圖像。它跳過頂部橫幅,徽標和導航欄中的文本和圖像。但是,SO's About頁面中沒有特殊的標籤或其他標題。他們甚至沒有使用,而是巧妙地從網頁內容中解析出來。 – <span class="text-secondary"> <small> <span></span> </small> </span> </p> </div> </div> </div> </div> </div> </article> <div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6208739752673518" data-ad-slot="1038284119" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="clearfix"> </div> <div class="relative-box"> <div class="relative">相關問題</div> <ul class="relative_list"> <li> 1. <a href="http://hk.uwenku.com/question/p-rcpplgwq-bdq.html" target="_blank" title="Facebook發佈到流並附加鏈接"> Facebook發佈到流並附加鏈接 </a> </li> <li> 2. <a href="http://hk.uwenku.com/question/p-tvrnucaa-bap.html" target="_blank" title="附加鏈接"> 附加鏈接 </a> </li> <li> 3. <a href="http://hk.uwenku.com/question/p-enfsawhb-sh.html" target="_blank" title="如何發佈附加鏈接到Facebook羣組?"> 如何發佈附加鏈接到Facebook羣組? </a> </li> <li> 4. <a href="http://hk.uwenku.com/question/p-taphklfc-bao.html" target="_blank" title="Google附加鏈接"> Google附加鏈接 </a> </li> <li> 5. <a href="http://hk.uwenku.com/question/p-tqtzynpj-qy.html" target="_blank" title="Google和Facebook如何實現並創建預覽鏈接功能?"> Google和Facebook如何實現並創建預覽鏈接功能? </a> </li> <li> 6. <a href="http://hk.uwenku.com/question/p-bnvqqpqc-bbs.html" target="_blank" title="如何通過Facebook鏈接實現Grooveshark-like Widget?"> 如何通過Facebook鏈接實現Grooveshark-like Widget? </a> </li> <li> 7. <a href="http://hk.uwenku.com/question/p-axtuannb-qd.html" target="_blank" title="如何實現Facebook新頁面鏈接ui視圖?"> 如何實現Facebook新頁面鏈接ui視圖? </a> </li> <li> 8. <a href="http://hk.uwenku.com/question/p-dyminrrz-pc.html" target="_blank" title="如何鏈接附加標題?"> 如何鏈接附加標題? </a> </li> <li> 9. <a href="http://hk.uwenku.com/question/p-fqhbmxfa-rp.html" target="_blank" title="區分HTML鏈接和圖像鏈接,如Facebook附着在.NET"> 區分HTML鏈接和圖像鏈接,如Facebook附着在.NET </a> </li> <li> 10. <a href="http://hk.uwenku.com/question/p-tflyxujj-ye.html" target="_blank" title="如何實現UPSERT與附加標準"> 如何實現UPSERT與附加標準 </a> </li> <div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-6208739752673518" data-ad-slot="4606349252"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <li> 11. <a href="http://hk.uwenku.com/question/p-przgydud-ot.html" target="_blank" title="鏈接如drive.google.com,app.codeable.io等如何實現?"> 鏈接如drive.google.com,app.codeable.io等如何實現? </a> </li> <li> 12. <a href="http://hk.uwenku.com/question/p-uhutjtfq-bdp.html" target="_blank" title="鏈接ArrayList實現"> 鏈接ArrayList實現 </a> </li> <li> 13. <a href="http://hk.uwenku.com/question/p-uvjvftdm-qe.html" target="_blank" title="如何實現鏈接的ListViews?"> 如何實現鏈接的ListViews? </a> </li> <li> 14. <a href="http://hk.uwenku.com/question/p-dcrjtnub-ok.html" target="_blank" title="如何實現「發送點燃」鏈接?"> 如何實現「發送點燃」鏈接? </a> </li> <li> 15. <a href="http://hk.uwenku.com/question/p-ybfsjlzg-bdt.html" target="_blank" title="如何實現更新鏈接"> 如何實現更新鏈接 </a> </li> <li> 16. <a href="http://hk.uwenku.com/question/p-tunyljbw-nw.html" target="_blank" title="如何實現「更多」鏈接與jQuery"> 如何實現「更多」鏈接與jQuery </a> </li> <li> 17. <a href="http://hk.uwenku.com/question/p-rohcwdey-oz.html" target="_blank" title="如何實現方法鏈接?"> 如何實現方法鏈接? </a> </li> <li> 18. <a href="http://hk.uwenku.com/question/p-szcmtkqd-bka.html" target="_blank" title="如何在draft.js中實現鏈接?"> 如何在draft.js中實現鏈接? </a> </li> <li> 19. <a href="http://hk.uwenku.com/question/p-gcyekwbc-vo.html" target="_blank" title="如何用鏈接實現哈希表?"> 如何用鏈接實現哈希表? </a> </li> <li> 20. <a href="http://hk.uwenku.com/question/p-cmdvwowu-ts.html" target="_blank" title="在Facebook附件中包含鏈接(流)"> 在Facebook附件中包含鏈接(流) </a> </li> <li> 21. <a href="http://hk.uwenku.com/question/p-cdhtrvyb-dz.html" target="_blank" title="shouldStartLoadWithRequest附加鏈接與applewebdata"> shouldStartLoadWithRequest附加鏈接與applewebdata </a> </li> <li> 22. <a href="http://hk.uwenku.com/question/p-njzlgpub-rx.html" target="_blank" title="鏈接jQuery的附加"> 鏈接jQuery的附加 </a> </li> <li> 23. <a href="http://hk.uwenku.com/question/p-muoydjea-tr.html" target="_blank" title="附加圖標鏈接MuPDF"> 附加圖標鏈接MuPDF </a> </li> <li> 24. <a href="http://hk.uwenku.com/question/p-eaamkkzg-ua.html" target="_blank" title="Javascript附加鏈接複製"> Javascript附加鏈接複製 </a> </li> <li> 25. <a href="http://hk.uwenku.com/question/p-ecciigni-bnu.html" target="_blank" title="附加到jQuery的鏈接"> 附加到jQuery的鏈接 </a> </li> <li> 26. <a href="http://hk.uwenku.com/question/p-napppxcx-vq.html" target="_blank" title="如何實現使用HOKO鏈接的延遲深度鏈接?"> 如何實現使用HOKO鏈接的延遲深度鏈接? </a> </li> <li> 27. <a href="http://hk.uwenku.com/question/p-rtbncvhc-bga.html" target="_blank" title="Apache Camel |如何實現鏈接的鏈接"> Apache Camel |如何實現鏈接的鏈接 </a> </li> <li> 28. <a href="http://hk.uwenku.com/question/p-agmnxord-he.html" target="_blank" title="如何實現鏈表的加法?"> 如何實現鏈表的加法? </a> </li> <li> 29. <a href="http://hk.uwenku.com/question/p-zbhbfzyu-ev.html" target="_blank" title="如何從Facebook鏈接"> 如何從Facebook鏈接 </a> </li> <li> 30. <a href="http://hk.uwenku.com/question/p-rlnsitog-zx.html" target="_blank" title="如何解碼Facebook鏈接"> 如何解碼Facebook鏈接 </a> </li> </ul> </div> <div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-6208739752673518" data-ad-slot="1575177025"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="padding-top-10"></div> </div> </div> <script type="text/javascript" src="http://img.uwenku.com/uwenku/script/side.js?t=1644592048261"></script> <script type="text/javascript" src="http://img.uwenku.com/uwenku/plugin/highlight/highlight.pack.js"></script> <link href="http://img.uwenku.com/uwenku/plugin/highlight/styles/docco.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $('pre').each(function(i, e) { hljs.highlightBlock(e, "<span class='indent'> </span>", false) }); </script> <div class="col-lg-3 col-md-4 col-sm-5"> <div id="rightTop"> <div class="row"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6208739752673518" data-ad-slot="5415218910" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="row sidebar panel panel-default"> <div class="panel-heading font-bold"> 最新問題 </div> <div class="m-b-sm m-t-sm clearfix"> <ul class="side_article_list"> <li class="side_article_list_item"> 1. <a href="http://hk.uwenku.com/question/p-uazvoukg-tn.html" target="_blank" title="Python的正則表達式:從一個字符串"> Python的正則表達式:從一個字符串 </a> </li> <li class="side_article_list_item"> 2. <a href="http://hk.uwenku.com/question/p-bfrziydq-py.html" target="_blank" title="分享偏好來保存個人資料圖片"> 分享偏好來保存個人資料圖片 </a> </li> <li class="side_article_list_item"> 3. <a href="http://hk.uwenku.com/question/p-tgbqscms-qh.html" target="_blank" title="有沒有辦法編寫一個函數,使用HttpServletRequest獲取IP地址而不將其作爲參數傳遞?"> 有沒有辦法編寫一個函數,使用HttpServletRequest獲取IP地址而不將其作爲參數傳遞? </a> </li> <li class="side_article_list_item"> 4. <a href="http://hk.uwenku.com/question/p-sqerijvi-qt.html" target="_blank" title="如何測試處理ImportErrors的代碼?"> 如何測試處理ImportErrors的代碼? </a> </li> <li class="side_article_list_item"> 5. <a href="http://hk.uwenku.com/question/p-rxiccvgv-rc.html" target="_blank" title="矩陣包中的提取速度與常規矩陣類相比非常緩慢"> 矩陣包中的提取速度與常規矩陣類相比非常緩慢 </a> </li> <li class="side_article_list_item"> 6. <a href="http://hk.uwenku.com/question/p-oxftnqwz-ro.html" target="_blank" title="pics not in codeignitor"> pics not in codeignitor </a> </li> <li class="side_article_list_item"> 7. <a href="http://hk.uwenku.com/question/p-bndlqtaj-rx.html" target="_blank" title="特殊按鈕形狀(稍微旋轉箭頭)"> 特殊按鈕形狀(稍微旋轉箭頭) </a> </li> <li class="side_article_list_item"> 8. <a href="http://hk.uwenku.com/question/p-ahxwsfxs-pp.html" target="_blank" title="emacs elisp切換到緩衝區,並按照"> emacs elisp切換到緩衝區,並按照 </a> </li> <li class="side_article_list_item"> 9. <a href="http://hk.uwenku.com/question/p-ylozrydp-ou.html" target="_blank" title="正在返回什麼以及本文檔中描述的功能正在採取什麼措施?"> 正在返回什麼以及本文檔中描述的功能正在採取什麼措施? </a> </li> <li class="side_article_list_item"> 10. <a href="http://hk.uwenku.com/question/p-eoouwcdf-pd.html" target="_blank" title="MySQL數據庫 - 字符集和歸類轉換爲utf8mb4和utf8mb4_unicode_ci?"> MySQL數據庫 - 字符集和歸類轉換爲utf8mb4和utf8mb4_unicode_ci? </a> </li> </ul> </div> </div> </div> <p class="article-nav-bar"></p> <div class="row sidebar article-nav"> <div class="row box_white visible-sm visible-md visible-lg margin-zero"> <div class="top"> <h3 class="title"><i class="glyphicon glyphicon-th-list"></i> 相關問題</h3> </div> <div class="article-relative-content"> <ul class="side_article_list"> <li class="side_article_list_item"> 1. <a href="http://hk.uwenku.com/question/p-rcpplgwq-bdq.html" target="_blank" title="Facebook發佈到流並附加鏈接"> Facebook發佈到流並附加鏈接 </a> </li> <li class="side_article_list_item"> 2. <a href="http://hk.uwenku.com/question/p-tvrnucaa-bap.html" target="_blank" title="附加鏈接"> 附加鏈接 </a> </li> <li class="side_article_list_item"> 3. <a href="http://hk.uwenku.com/question/p-enfsawhb-sh.html" target="_blank" title="如何發佈附加鏈接到Facebook羣組?"> 如何發佈附加鏈接到Facebook羣組? </a> </li> <li class="side_article_list_item"> 4. <a href="http://hk.uwenku.com/question/p-taphklfc-bao.html" target="_blank" title="Google附加鏈接"> Google附加鏈接 </a> </li> <li class="side_article_list_item"> 5. <a href="http://hk.uwenku.com/question/p-tqtzynpj-qy.html" target="_blank" title="Google和Facebook如何實現並創建預覽鏈接功能?"> Google和Facebook如何實現並創建預覽鏈接功能? </a> </li> <li class="side_article_list_item"> 6. <a href="http://hk.uwenku.com/question/p-bnvqqpqc-bbs.html" target="_blank" title="如何通過Facebook鏈接實現Grooveshark-like Widget?"> 如何通過Facebook鏈接實現Grooveshark-like Widget? </a> </li> <li class="side_article_list_item"> 7. <a href="http://hk.uwenku.com/question/p-axtuannb-qd.html" target="_blank" title="如何實現Facebook新頁面鏈接ui視圖?"> 如何實現Facebook新頁面鏈接ui視圖? </a> </li> <li class="side_article_list_item"> 8. <a href="http://hk.uwenku.com/question/p-dyminrrz-pc.html" target="_blank" title="如何鏈接附加標題?"> 如何鏈接附加標題? </a> </li> <li class="side_article_list_item"> 9. <a href="http://hk.uwenku.com/question/p-fqhbmxfa-rp.html" target="_blank" title="區分HTML鏈接和圖像鏈接,如Facebook附着在.NET"> 區分HTML鏈接和圖像鏈接,如Facebook附着在.NET </a> </li> <li class="side_article_list_item"> 10. <a href="http://hk.uwenku.com/question/p-tflyxujj-ye.html" target="_blank" title="如何實現UPSERT與附加標準"> 如何實現UPSERT與附加標準 </a> </li> </ul> </div> </div> </div> </div> </div> </div> </div><!-- wrap end--> <!-- footer --> <footer id="footer"> <div class="bg-simple lt"> <div class="container"> <div class="row padder-v m-t"> <div class="col-xs-8"> <ul class="list-inline"> <li><a href="http://hk.uwenku.com/contact">聯系我們</a></li> <li>© 2020 HK.UWENKU.COM</li> <li><a target="_blank" href="https://beian.miit.gov.cn/">沪ICP备13005482号-4</a></li> <li><script type="text/javascript" src="https://v1.cnzz.com/z_stat.php?id=1280101193&web_id=1280101193"></script></li> <li><a href="http://www.uwenku.com/" target="_blank" title="优文库">简体中文</a></li> <li><a href="http://hk.uwenku.com/" target="_blank" title="優文庫">繁體中文</a></li> <li><a href="http://ru.uwenku.com/" target="_blank" title="поле вопросов и ответов">Русский</a></li> <li><a href="http://de.uwenku.com/" target="_blank" title="Frage - und - antwort - Park">Deutsch</a></li> <li><a href="http://es.uwenku.com/" target="_blank" title="Preguntas y respuestas">Español</a></li> <li><a href="http://hi.uwenku.com/" target="_blank" title="कार्यक्रम प्रश्न और उत्तर पार्क">हिन्दी</a></li> <li><a href="http://it.uwenku.com/" target="_blank" title="IL Programma di chiedere Park">Italiano</a></li> <li><a href="http://ja.uwenku.com/" target="_blank" title="プログラム問答園区">日本語</a></li> <li><a href="http://ko.uwenku.com/" target="_blank" title="프로그램 문답 단지">한국어</a></li> <li><a href="http://pl.uwenku.com/" target="_blank" title="program o park">Polski</a></li> <li><a href="http://tr.uwenku.com/" target="_blank" title="Program soru ve cevap parkı">Türkçe</a></li> <li><a href="http://vi.uwenku.com/" target="_blank" title="Đáp ứng viên">Tiếng Việt</a></li> <li><a href="http://fr.uwenku.com/" target="_blank" title="Programme interrogation Park">Française</a></li> </ul> </div> </div> </div> </div> </div> </footer> <!-- / footer --> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?f78a970f17b19a79fc477a3378096f29"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>