Skip to content

Browser Control #79

@philippta

Description

@philippta

Currently, when browser mode is enabled:

  1. flyscrape will use a browser to navigate to a page
  2. Wait until the page loaded and return its HTML
  3. Which then can be used for scraping

The browser control feature should support direct control of the browser, so that it can be used for page interaction and data extraction.

Example code:

export const config = {
  url: 'https://example.com/',
  browserControl: true,
};

export default function ({ doc, browser }) {
  browser.waitPageLoaded();
  browser.waitVisible(".products");

  const productImages = browser.find(".products").map((product) => {
    product.find(".swatches").click();

    return product.find(".product-image").attr("src");
  });

  return {
    productImages,
  };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions