Closed udbhav-s closed 4 years ago
Since the image file name was in the infobox, this is the workaround I'm using:
let image = await page.mainImage();
if (!image) {
image =
Object.values((await page.fullInfo()).general)
.find(val => /.*\.(png|jpeg|jpg|svg)$/.test(val));
if (image) image = encodeURI('https://en.wikipedia.org/wiki/Special:FilePath/' + image);
}
Great find. This is fixed in v6.0.1
Still reproducible in v6.3.3
On running
it returns undefined even though the infobox in the Microsoft wikipedia article has 2 images. Is there any way to get the image?