我需要检查一个网站,如果它使用一个特殊的在线js源(例如,fontawesome)。
顺便说一下,有些只能在加载时才能找到,而不能从网站源码html中找到。我试过玩木偶戏,但花了很长时间。我认为原因是它加载了其他资源,比如图片。
对此有什么解决方案吗?谢谢您抽时间见我。
发布于 2019-07-01 06:02:54
这是由phantomjs解决的
const phantom = require('phantom');
(async function() {
const instance = await phantom.create();
const page = await instance.createPage();
await page.on('onResourceRequested', function(requestData) {
console.info('Requesting', requestData.url);
});
const status = await page.open('https://stackoverflow.com/');
const content = await page.property('content');
console.log(content);
await instance.exit();
})();发布于 2019-06-28 00:09:52
如果您正在寻找源代码,您可以在大多数浏览器中执行此操作。例如,如果您按下Control+ Shift+I,然后选择sources选项卡,这将为您提供网页的源代码。您是否正在寻找脚本来自动执行此过程?
https://stackoverflow.com/questions/56794698
复制相似问题