UNPKG

stepwright

Version:

A powerful web scraping library built with Playwright

124 lines 3.77 kB
import { Browser, LaunchOptions, Page, Locator } from 'playwright'; import { SelectorType } from './types'; /** * Get the browser and page. * * @param {object} params - The browser params. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The browser. * @since v1.0.0 * @company Framework Island */ declare const getBrowser: (params?: LaunchOptions) => Promise<Browser>; /** * Navigate to the given url. * * @param {object} page - The page object. * @param {string} url - The url to navigate. * @param {number} wait - The time to wait. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The page object. * @since v1.0.0 * @company Framework Island */ declare const navigate: (page: Page, url: string, wait?: number) => Promise<Page>; /** * Get the element. * * @param {object} page - The page object. * @param {string} type - The type of selector. * @param {string} selector - The selector. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The element. * @since v1.0.0 * @company Framework Island */ declare const elem: (page: Page, type: SelectorType, selector: string, wait?: number) => Promise<Locator>; /** * Input the value in the given selector. * * @param {object} page - The page object. * @param {string} type - The type of selector. * @param {string} selector - The selector. * @param {string} value - The value to input. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The page object. * @since v1.0.0 * @company Framework Island */ declare const input: (page: Page, type: SelectorType, selector: string, value: string, wait?: number) => Promise<Page>; /** * Click on the given selector. * * @param {object} page - The page object. * @param {string} type - The type of selector. * @param {string} selector - The selector. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The page object. * @since v1.0.0 * @company Framework Island */ declare const click: (page: Page, type: SelectorType, selector: string) => Promise<Page>; /** * Double click on the given selector. * * @param {object} page - The page object. * @param {string} type - The type of selector. * @param {string} selector - The selector. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The page object. * @since v1.0.0 * @company Framework Island */ declare const doubleClick: (page: Page, type: SelectorType, selector: string) => Promise<Page>; /** * Click on the checkbox. * * @param {object} page - The page object. * @param {string} type - The type of selector. * @param {string} selector - The selector. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {object} - The page object. * @since v1.0.0 * @company Framework Island */ declare const clickCheckBox: (page: Page, type: SelectorType, selector: string) => Promise<Page>; /** * Get the data from the given selector. * * @param {object} page - The page object. * @param {string} type - The type of selector. * @param {string} selector - The selector. * @param {string} data_type - The type of data to get. * * @since v1.0.0 * @author Muhammad Umer Farooq <umer@lablnet.com> * * @returns {string} - The data. * @since v1.0.0 * @company Framework Island */ declare const getData: (page: Page, type: SelectorType, selector: string, data_type?: "text" | "html" | "value" | "default", wait?: number) => Promise<string>; export { getBrowser, navigate, elem, input, click, doubleClick, clickCheckBox, getData, }; //# sourceMappingURL=scraper.d.ts.map