async function scrape( options ) {
	var candidates;
	var browser;
	var content;
	var results;
	var page;
	var opts;
	var name;
	var desc;
	var link;
	var ctx;
	var tmp;
	var url;
	var sig;
	var row;
	var $;
	var i;
	var j;

	opts = {
		'browser': 'chromium'
	};
	if ( arguments.length ) {
		opts.browser = options.browser;
	}
	debug( 'Options: %s', JSON.stringify( opts ) );

	debug( 'Launching %s browser...', opts.browser );
	browser = await playwright[ opts.browser ].launch();

	debug( 'Creating a new browser context...' );
	ctx = await browser.newContext();

	debug( 'Creating a new browser page...' );
	page = await ctx.newPage();

	debug( 'Navigating to %s.', NUMPY_METHOD_DOCS_URL );
	await page.goto( NUMPY_METHOD_DOCS_URL );

	debug( 'Loading page content...' );
	content = await page.content();

	debug( 'Searching for applicable APIs...' );
	$ = cheerio.load( content );
	candidates = $( '.longtable.table tr' );

	debug( 'Found %d potential APIs. Filtering candidate list...', candidates.length );
	results = [];
	for ( i = 0; i < candidates.length; i++ ) {
		row = $( candidates.get( i ) );
		sig = row.children().first();
		tmp = sig.text();
		j = tmp.indexOf( '(' );
		if ( j >= 0 ) {
			name = tmp.substring( 0, j );
		} else {
			name = tmp;
		}
		desc = sig.next().text();

		link = sig.find( 'a' ).attr( 'href' );
		url = NUMPY_DOCS_ROOT_URL + link;

		sig = sig.text();

		debug( 'Found an interface definition.' );
		debug( 'Name: %s', name );
		debug( 'Signature: %s', sig );
		debug( 'Description: %s', desc );
		results.push({
			'name': name,
			'description': desc,
			'signature': sig,
			'url': url
		});
	}
	debug( 'Sorting results...' );
	results = sort( results );

	debug( 'Finished.' );

	debug( 'Closing browser...' );
	await browser.close();
	debug( 'Browser closed.' );

	debug( 'Total APIs: %d', results.length );

	return results;
}
/**
* Returns a promise for scraping NumPy's API documentation for a list of public method APIs (e.g., array manipulation methods, etc).
*
* @private
* @param {Object} [options] - options
* @param {string} [options.browser='chromium'] - browser engine
* @returns {Object} results
*
* @example
* var results = await scrape();
*/
Returns a promise for scraping NumPy's API documentation for a list of public method APIs .
Returns a promise for scraping NumPy ' s API documentation for a list of public method APIs .
async function scrape( options ) {
	var candidates;
	var browser;
	var content;
	var results;
	var page;
	var opts;
	var name;
	var desc;
	var link;
	var ctx;
	var tmp;
	var url;
	var sig;
	var row;
	var $;
	var i;
	var j;
	opts = {
		'browser': 'chromium'
	};
	if ( arguments.length ) {
		opts.browser = options.browser;
	}
	debug( 'Options: %s', JSON.stringify( opts ) );
	debug( 'Launching %s browser...', opts.browser );
	browser = await playwright[ opts.browser ].launch();
	debug( 'Creating a new browser context...' );
	ctx = await browser.newContext();
	debug( 'Creating a new browser page...' );
	page = await ctx.newPage();
	debug( 'Navigating to %s.', NUMPY_METHOD_DOCS_URL );
	await page.goto( NUMPY_METHOD_DOCS_URL );
	debug( 'Loading page content...' );
	content = await page.content();
	debug( 'Searching for applicable APIs...' );
	$ = cheerio.load( content );
	candidates = $( '.longtable.table tr' );
	debug( 'Found %d potential APIs. Filtering candidate list...', candidates.length );
	results = [];
	for ( i = 0; i < candidates.length; i++ ) {
		row = $( candidates.get( i ) );
		sig = row.children().first();
		tmp = sig.text();
		j = tmp.indexOf( '(' );
		if ( j >= 0 ) {
			name = tmp.substring( 0, j );
		} else {
			name = tmp;
		}
		desc = sig.next().text();
		link = sig.find( 'a' ).attr( 'href' );
		url = NUMPY_DOCS_ROOT_URL + link;
		sig = sig.text();
		debug( 'Found an interface definition.' );
		debug( 'Name: %s', name );
		debug( 'Signature: %s', sig );
		debug( 'Description: %s', desc );
		results.push({
			'name': name,
			'description': desc,
			'signature': sig,
			'url': url
		});
	}
	debug( 'Sorting results...' );
	results = sort( results );
	debug( 'Finished.' );
	debug( 'Closing browser...' );
	await browser.close();
	debug( 'Browser closed.' );
	debug( 'Total APIs: %d', results.length );
	return results;
}
async function scrape ( options ) { var candidates ; var browser ; var content ; var results ; var page ; var opts ; var name ; var desc ; var link ; var ctx ; var tmp ; var url ; var sig ; var row ; var $ ; var i ; var j ; opts = { 'browser' : 'chromium' } ; if ( arguments . length ) { opts . browser = options . browser ; } debug ( 'Options: %s' , JSON . stringify ( opts ) ) ; debug ( 'Launching %s browser...' , opts . browser ) ; browser = await playwright [ opts . browser ] . launch ( ) ; debug ( 'Creating a new browser context...' ) ; ctx = await browser . newContext ( ) ; debug ( 'Creating a new browser page...' ) ; page = await ctx . newPage ( ) ; debug ( 'Navigating to %s.' , NUMPY_METHOD_DOCS_URL ) ; await page . goto ( NUMPY_METHOD_DOCS_URL ) ; debug ( 'Loading page content...' ) ; content = await page . content ( ) ; debug ( 'Searching for applicable APIs...' ) ; $ = cheerio . load ( content ) ; candidates = $ ( '.longtable.table tr' ) ; debug ( 'Found %d potential APIs. Filtering candidate list...' , candidates . length ) ; results = [ ] ; for ( i = 0 ; i < candidates . length ; i ++ ) { row = $ ( candidates . get ( i ) ) ; sig = row . children ( ) . first ( ) ; tmp = sig . text ( ) ; j = tmp . indexOf ( '(' ) ; if ( j >= 0 ) { name = tmp . substring ( 0 , j ) ; } else { name = tmp ; } desc = sig . next ( ) . text ( ) ; link = sig . find ( 'a' ) . attr ( 'href' ) ; url = NUMPY_DOCS_ROOT_URL + link ; sig = sig . text ( ) ; debug ( 'Found an interface definition.' ) ; debug ( 'Name: %s' , name ) ; debug ( 'Signature: %s' , sig ) ; debug ( 'Description: %s' , desc ) ; results . push ( { 'name' : name , 'description' : desc , 'signature' : sig , 'url' : url } ) ; } debug ( 'Sorting results...' ) ; results = sort ( results ) ; debug ( 'Finished.' ) ; debug ( 'Closing browser...' ) ; await browser . close ( ) ; debug ( 'Browser closed.' ) ; debug ( 'Total APIs: %d' , results . length ) ; return results ; }
Returns a promise for scraping NumPy's API documentation for a list of public method APIs (e.g., array manipulation methods, etc).
Returns a promise for scraping NumPy ' s API documentation for a list of public method APIs ( e . g . array manipulation methods etc ) .