Can googlebot do basic javascript? [duplicate]

拈花ヽ惹草 提交于 2019-12-08 18:52:29

The safest answer is: don't rely on it. In particular because you're doing heavy DOM coding.

If the code must be in Google for search purposes then create that part of the HTML on the server and use JavaScript only for interaction. Google's web crawlers are getting smarter but I don't expect them to understand arbitrary JavaScript code.

kiswa

Yes, Google’s Bots Understand Code
How much javascript does Googlebot read
Google Admits GoogleBot can Parse and Execute JavaScript Code on-the-fly

You may find this useful as well: View a Web Page as 'Googlebot'

And for completeness: Google 'googlebot javascript' and these are all on the first page.

On my own side, I can confirm GoogleBot executes JavaScript, and according to the IP, it was really it, and not just UA spoofing from a browser.

I learned it today, when I wanted to generate some statistics on the use of AdBlockPlus and the likes, when I saw GoogleBot appearing in the logs, which I was not expecting. Seems he also use JavaScript execution to figure some new URLs to crawl; I mean, if a JavaScript loads a page in an IFRAME with some parameters in the URL, it may first try to load the page without the parameters, then only later try to load the page with the parameters. This may suggest it first execute the JavaScript in a kind of sandbox to see what it do.

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