You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
Well, more like an suggestion, than a "bug" report.
I think you shouldn't load the full instagram page.
First, the element classes (inside elements.json), change with some frequency (have no ideia wich frequency is that).
So, my sugestion it 's just load _sharedData inside the profile.
Don't load javascripts, images, styles.. It's way faster.
Something like this:
this.page = await this.browser.newPage();
await this.page.setRequestInterception(true);
this.page.on('request', (request) => {
if (['image', 'stylesheet', 'font', 'script'].indexOf(request.resourceType()) !== -1) {
request.abort();
} else {
request.continue();
}
});
await this.page.setExtraHTTPHeaders({
'Accept-Language': 'pt-BR'
});
await this.page.goto('https://instagram.com/' + username, {
waitUntil: 'networkidle0'
});
const sharedData = document.querySelector('script').innerText;
const html = /window._sharedData = (.*);/.exec(sharedData)[1];
const profileData = JSON.parse(html);
/* Maybe here you could use your version 1.0 "parseData" function from here ? */
The text was updated successfully, but these errors were encountered:
Well, more like an suggestion, than a "bug" report.
I think you shouldn't load the full instagram page.
First, the element classes (inside elements.json), change with some frequency (have no ideia wich frequency is that).
So, my sugestion it 's just load _sharedData inside the profile.
Don't load javascripts, images, styles.. It's way faster.
Something like this:
The text was updated successfully, but these errors were encountered: