microlink logo
  • Products
  • Developers
  • Pricing
  • Company
    • Changelog
    • Community
    • docs
    • Recipes
    • User Agents
    Getting Started
    Overview
    Data fields
    CLI
    API Basics
    Authentication
    Cache
    Compression
    Endpoint
    Error codes
    Format
    Rate limit
    API Parameters
    adblock
    animations
    audio
    click
    colorScheme
    data
    device
    embed
    filename
    filter
    force
    function
    headers
    iframe
    insights
    lighthouse
    technologies
    javascript
    mediaType
    meta
    modules
    palette
    pdf
    format
    height
    landscape
    margin
    pageRanges
    scale
    width
    ping
    prerender
    proxy
    retry
    screenshot
    codeScheme
    element
    fullPage
    overlay
    omitBackground
    type
    scripts
    scroll
    styles
    staleTtl
    timeout
    ttl
    url
    video
    viewport
    waitForSelector
    waitForTimeout
    waitUntil

    waitForSelector

    Type:
    <string>

    It tells the browser to wait until a specific
    CSS selector
    appears over the target url.
    • CLI
    • JavaScript
    • Shell
    • Python
    • Ruby
    const mql = require('@microlink/mql')
    
    const { status, data } = await mql('https://dev.to', {
      screenshot: true,
      waitForSelector: 'main'
    })
    
    mql.render(data)
    Last edited on January 22, 2025
    Edit on GitHub