Does Twitter's URL crawler execute JavaScript?

北战南征 提交于 2021-02-08 16:39:13

问题


When Twitter scrapes URLs to render Twitter cards (configured via meta tags), will Twitter first execute your JavaScript or do they require that these tags are sent directly from the server?

Reason I ask is it's 2016 so I'm developing a single page application. No matter what URL you request, I'll return /index.html which fetches my JS and dynamically loads whichever page you requested (including meta tags) on the client.

I know Google will run your JS, but does Twitter?


回答1:


After using Twitter's Card Validator (https://cards-dev.twitter.com/validator), it looks like the answer is sadly no because I just tested this out in production and they don't seem to detect the meta tags I add dynamically.



来源:https://stackoverflow.com/questions/35882222/does-twitters-url-crawler-execute-javascript

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