简体   繁体   中英

Get source code after JS has run

I'm trying to retrieve the source code of a page, but the problem is that some of the content loads through AJAX or similar.. this content doesn't appear in the normal source code fetched through PHP's file_get_contents.

Is there any way to get this? (On the server side, not via browser developer tools and such.)

Try the Web Developer extension for firefox. You can right click a page and click "View Generated Source" from one of the Web Developer options.

Hope this is what you needed.

When ever i need to test this i use something like FireBug (for firefox but there's a 'light' version that can be used on other browsers).

Firebug is great for this since it will show you the exact code (html, javascript,..) that the browser is using to generate the page

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM