Skip to content

getElementSelectors

getElementSelectors is a method of AI application instance, usually used to intelligently generate element selectors.

type

parseElements API is a function.

ts
function getElementSelectors(
  HTML: string,
  content: string | CrawlOpenAIGetElementSelectorsContentOptions,
  option?: CrawlOpenAICommonAPIOtherOption
): Promise<CrawlOpenAIGetElementSelectorsResult>

Parameter Type:

Return value type:

Example

js
import { createCrawlOpenAI } from 'x-crawl'

const crawlOpenAIApp = createCrawlOpenAI()

crawlOpenAIApp
  .getElementSelectors('HTML', 'Tell the AI what you want')
  .then((res) => {})

Released under the MIT license