Skip to main content

Tool and library for searching the web and return results

Project description

Search-Tool

A unified interface and CLI for performing web searches across various search engines using Playwright.

Installation

uv tool install search-tool

Or use pip/pipx:

pip install search-tool
pipx install search-tool

Usage

CLI

# Basic search
st python decorator

# get first page
st -p1 current weather dallas tx

# Search with a specific engine
st -e brave "Python async programming"

# Sync cookies from Chrome to bypass logins (e.g., for Twitter/X)
st --sync-cookies chrome --sync-domains .x.com .twitter.com

Python API

import asyncio
from search_tool import SearchTool, SearchConfig

async def main():
    config = SearchConfig(search_engine="google", num_results=5)
    async with SearchTool(config) as tool:
        results = await tool.search("OpenAI o3-mini")
        for result in results.web_results:
            print(f"{result.title}: {result.url}")

if __name__ == "__main__":
    asyncio.run(main())

Cookie Syncing

The --sync-cookies flag allows you to import logged-in sessions from your existing browser (Chrome, Firefox, Edge, Brave, Safari, Opera) into Playwright's isolated persistent profile. This is particularly useful for:

  • Bypassing login screens on social media sites.
  • Avoiding captchas.
  • Searching authenticated content.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

search_tool-0.2.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

search_tool-0.2.0-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file search_tool-0.2.0.tar.gz.

File metadata

  • Download URL: search_tool-0.2.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/5.15.0-164-generic

File hashes

Hashes for search_tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 23a07f3be244e43e133a07bac843abdd755cfb163371b8c9a476203eca007961
MD5 87856b981048a0aaa4f255aad15790b7
BLAKE2b-256 3a75dab997c8472f902040381d3ac94d7aab89b565ce21bc69ab34e1063ce0e0

See more details on using hashes here.

File details

Details for the file search_tool-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: search_tool-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/5.15.0-164-generic

File hashes

Hashes for search_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48ea3f3d21a4f95a5b4ec363724b7e08fccfcc26b3547b44befea0176983461f
MD5 98926477fb053dc03506335c43e5f302
BLAKE2b-256 4fd4231526868ece055eae27c54658ead5bc8056d3ee02afcf6ec8739b4c8599

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page