我想讓Facebook Crawler訪問網站上的Open Graph標記的元信息,但它不讀取頭標記的內容。開放圖頭元標記無法訪問Facebook Crawler
如果我附和刮信息,它顯示了頭標記爲:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>
<body>
...
在頁面的源代碼,但是,頭信息包含meta標籤:
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="always" />
<meta property="fb:app_id" content="375576830972731" />
<meta property="og:site_name" content="Site Name" />
<meta property="og:title" content="Title of content" />
<meta property="og:url" content="https://website.domain.com/123456" />
<meta property="og:image" content="http://s3-us-west-1.amazonaws.com/domain/media/images/001/original/001" />
<meta property="og:description" content="Description of content" />
<meta property="og:type" content="article" />
</head>
我控制器設置爲允許`protect_from_forgery「例外,並且我確保允許robots.txt中的Facebook抓取工具:
User-agent: Facebot
Allow:/
User-agent: facebookexternalhit/1.1
Allow:/
爲什麼Facebook的抓取工具無法訪問我的標題中的元標記?
你有[驗證](http://validator.w3.org/)你的HTML嗎?示例URL,以便我們可以看看這個問題? – CBroe