0

I'm using phantom to scrape a dynamic web page content and i need to scroll down to display all of the page content .

I've tried this await page.property('scrollPosition', { top: 1000, left: 0 }); but it didn't work for me and the content still the same.

this is my code :

(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://www.articles-epresse.fr/media/894eab75-c642-46a2-a1ba-b240c278ebbc?"
    );

    if (status == "success") {
      await page.property("scrollPosition", {
        top: 1000,
        left: 0
      });
    }
    const content = await page.property("content");

    console.log(content);
    var $ = cheerio.load(content);

Any idea ?

Az Emna
  • 527
  • 2
  • 10
  • 26

1 Answers1

0

i just needed to increment the value of top to 3000 so it could scrape the rest of the page

Az Emna
  • 527
  • 2
  • 10
  • 26