Error parsing input URL, no data was scraped. only with new pages on my site

↘锁芯ラ 提交于 2019-12-05 16:19:52
Kzar

For people experiencing the same problem but for different causes, I discovered a few interesting things about how Facebook "scrapes" pages, checking the logs of the server while doing some trials.

First of all: if you never tried to share a page with FB, FB never tried to scrape it, and it will not try to do so if you only put the url in the Debug tool. That's the first reason because you get the error: it just states that FB has no information on the page, you must "force" it to scrape the page.

The first time you try to share a page, FB scrapes it (asks your server the first 40k of the page and analyse the opengraph tags). What can happen is that you do not see the image: Facebook Share Dialog does not display thumbnails one first load

The reason is that FB behind the scenes is still scraping your page and caching the image. The next time, in fact, you have also the image. How to solve it? Pre caching: https://developers.facebook.com/docs/sharing/best-practices#precaching

or simply add

<meta property="og:image:width" content="450"/>
<meta property="og:image:height" content="298"/>

I was pulling my hair out trying to fix this issue. Hours and hours of troubleshooting to no avail. After speaking with one of our programmers about a topic unrelated I thought of something to try as a long shot.

Much to my surprise, it worked!!!

This is the reason behind the problem and my solution for it:

When you draft a post in WordPress it generates a link based on your article's title (unless you manually change it). The title of my article included special characters, however the auto-generated link didn't display these special characters, only hyphens to replace the spaces. Should be fine right? Wrong! Somewhere embedded in metadata and code in the WordPress platform are those special characters and they mess up the way Facebook pulls info from the article being linked to. This is a problem because certain special characters invalidate hyperlinks.

For example:

Article Title: R[eloaded]

Auto-generated hyperlink DISPLAYED in WordPress "Permalink" field: http://www.example.com/reloaded

Actual WordPress Auto-generated hyperlink: http://www.example.com/r[eloaded]

Those brackets will invalidate the link and Facebook will be unable to pull any information (ie pictures) from it.

Solution:

(1) Simply, manually change the WordPress hyperlink address to something that doesn't include any special characters (this will not change the title of your article).

(2) Click "Update" to change the post to include the new hyperlink.

(3) Click "Purge from Cache" in the WordPress window

(4) Refresh your Facebook browser window

(5) Paste the new hyperlink for your article

(6) Enjoy your Facebook post with a preview image and information

Sidenote: Don't pull your hair out over Facebook, it's not worth it. =)

If you're using Wordpress, edit the post in question to change the permalink (just alter it slightly), then update the post. Using the new permalink in the Facebook OG debugger should now work.

It's a weird fix, but I think it takes care of a problem caused by special characters being used in the title of a post, which is then used to make the permalink.

Its all about DNS issue, was having same issue and resolved it by updating domain name servers to actual name servers.

In my case my domain was pointed to ns1.websterz.net and ns2.websterz.net and on this server i had DNS redirect to my other server (where web site is hosted). I Just updated name servers of the domain to actual name servers where my web site is hosted on. This was account migration case i forgot to update name servers as of new server.

Everything works fine now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!