360 Secure SkillHub
360 安全技能中心

free_google_search_with_browser

通过 Python 脚本调用 scrapling 与 playwright 启动可见浏览器窗口访问 Google,抓取搜索结果并整理为标题、链接、摘要。需 Python 3 环境、已安装浏览器依赖,且运行环境支持图形界面;附带 verify_search.py 用于调试验证。

qipengguo
qipengguo
热度 96.22
最近更新 2026-05-11 17:30:03
分类:搜索依赖:代码执行 / 联网浏览搜索应用场景:研究

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add free-google-search-with-browser
Metadata
name
free-google-search-with-browser
description
Search Google using scrapling and return structured results (title, link, snippet). Invoke when user asks to search Google or find information online. Your device should be able to lanuch broswer with UI.

Google Search

This skill searches Google using a stealthy fetcher and returns structured results suitable for LLM consumption.

Usage

Run the python script google_search.py with the query as an argument.

python google_search.py "<query>"

File Structure

  • google_search.py: The main script. It uses scrapling to perform the Google search. It launches a browser instance to fetch results, ensuring high success rates by mimicking real user behavior.
  • verify_search.py: A debugging script. It runs a predefined set of queries to verify that the search functionality works correctly.
  • requirements.txt: Lists the Python dependencies required for the project.

Requirements

  • Python 3
  • scrapling package installed (with playwright and curl_cffi dependencies)

To install dependencies:

pip install -r requirements.txt
playwright install  # Required for browser automation. If slow, consider downloading manually.

Notes & Troubleshooting

Browser Environment (Headless=False)

This skill is configured to run with headless=False (see google_search.py). This means:

  1. GUI Required: The environment where this code runs must support a Graphical User Interface (GUI). It will launch a visible browser window.
  2. No Headless Servers: It will likely fail on headless servers (like standard CI/CD runners or SSH-only servers) unless X11 forwarding or a virtual display (like xvfb) is configured.

Debugging with verify_search.py

If you encounter issues or want to test if the setup is working:

  1. Run python verify_search.py.
  2. This script will execute several test queries (e.g., "python tutorial", mixed English/Chinese).
  3. Watch the browser window to see if it opens and loads Google results.
  4. Check the console output for success messages or error logs.