我正在抓取我保存的 Facebook 卷轴,进展顺利,但我还尝试捕获视频的标题或描述以及文件名以插入到数据库中。当我使用这个API时:
facebook-reel-and-video-downloader.p.rapidapi.com
,我没有得到信息。
当我尝试使用 Javascript 并直接进入该页面时,我什么也得不到。有什么想法如何捕获这些信息吗?这是我尝试过的一个例子。我尝试粘贴到 Firefox 和 Chrome 的控制台中,但我得到的只是大量的 JavaScript,在验证所有内容后,这些 JavaScript 将用于最终构建页面。
(function(ns, fetch) {
if (typeof fetch !== 'function') return;
ns.fetch = function() {
var out = fetch.apply(this, arguments);
// side-effect
out.then(function(response) {
// When the page is loaded convert it to text
return response.text()
})
.then(function(html) {
// Initialize the DOM parser
var parser = new DOMParser();
// Parse the text
var doc = parser.parseFromString(html, "text/html");
console.log(doc);
})
.catch(function(err) {
console.log('Failed to fetch page: ', err);
})
return out;
}
}(window, window.fetch));
fetch('https://www.facebook.com/reel/1340650889956366');
使用 Apify,您可以从 Facebook Reel Scraper 获取这些信息。 https://apify.com/jeremy_frost/facebook-reel-scraper