Skip to main content
Glama

mcp-server-webcrawl

mcp_server_webcrawl.extras.html28.8 kB
<!DOCTYPE html> <html class="writer-html5" lang="en" data-content_root="./"> <head> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>mcp_server_webcrawl.extras package &mdash; mcp-server-webcrawl documentation</title> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" /> <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" /> <script src="_static/jquery.js?v=5d32c60e"></script> <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> <script src="_static/documentation_options.js?v=5929fcd5"></script> <script src="_static/doctools.js?v=888ff710"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/js/theme.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="mcp_server_webcrawl.models package" href="mcp_server_webcrawl.models.html" /> <link rel="prev" title="mcp_server_webcrawl.crawlers.wget package" href="mcp_server_webcrawl.crawlers.wget.html" /> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > <a href="index.html" class="icon icon-home"> mcp-server-webcrawl </a> <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li> <li class="toctree-l1"><a class="reference internal" href="guides.html">Setup Guides</a></li> <li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li> <li class="toctree-l1"><a class="reference internal" href="prompts.html">Prompt Routines</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">mcp_server_webcrawl</a><ul class="current"> <li class="toctree-l2 current"><a class="reference internal" href="mcp_server_webcrawl.html">mcp_server_webcrawl package</a></li> </ul> </li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">mcp-server-webcrawl</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li> <li class="breadcrumb-item"><a href="modules.html">mcp_server_webcrawl</a></li> <li class="breadcrumb-item"><a href="mcp_server_webcrawl.html">mcp_server_webcrawl package</a></li> <li class="breadcrumb-item active">mcp_server_webcrawl.extras package</li> <li class="wy-breadcrumbs-aside"> <a href="_sources/mcp_server_webcrawl.extras.rst.txt" rel="nofollow"> View page source</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <section id="mcp-server-webcrawl-extras-package"> <h1>mcp_server_webcrawl.extras package<a class="headerlink" href="#mcp-server-webcrawl-extras-package" title="Link to this heading"></a></h1> <section id="submodules"> <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading"></a></h2> </section> <section id="module-mcp_server_webcrawl.extras.markdown"> <span id="mcp-server-webcrawl-extras-markdown-module"></span><h2>mcp_server_webcrawl.extras.markdown module<a class="headerlink" href="#module-mcp_server_webcrawl.extras.markdown" title="Link to this heading"></a></h2> <dl class="py class"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.markdown.MarkdownTransformer"> <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MarkdownTransformer</span></span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/markdown.html#MarkdownTransformer"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.markdown.MarkdownTransformer" title="Link to this definition"></a></dt> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> <p>Memoizes the XSLT transformer</p> <dl class="py method"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.markdown.MarkdownTransformer.get_xslt_transform"> <em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">get_xslt_transform</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/markdown.html#MarkdownTransformer.get_xslt_transform"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.markdown.MarkdownTransformer.get_xslt_transform" title="Link to this definition"></a></dt> <dd><p>Get the HTML to text markdown XSLT transformer</p> </dd></dl> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.markdown.get_markdown"> <span class="sig-name descname"><span class="pre">get_markdown</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">content</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/markdown.html#get_markdown"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.markdown.get_markdown" title="Link to this definition"></a></dt> <dd><p>Transform HTML content to Markdown using XSLT.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><p><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The HTML content to transform.</p> </dd> <dt class="field-even">Returns<span class="colon">:</span></dt> <dd class="field-even"><p><dl class="simple"> <dt>The transformed Markdown string, or None if the input is empty</dt><dd><p>or if transformation fails (e.g., due to invalid HTML or XSLT errors).</p> </dd> </dl> </p> </dd> <dt class="field-odd">Return type<span class="colon">:</span></dt> <dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a> | None</p> </dd> </dl> </dd></dl> </section> <section id="module-mcp_server_webcrawl.extras.regex"> <span id="mcp-server-webcrawl-extras-regex-module"></span><h2>mcp_server_webcrawl.extras.regex module<a class="headerlink" href="#module-mcp_server_webcrawl.extras.regex" title="Link to this heading"></a></h2> <dl class="py function"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.regex.get_regex"> <span class="sig-name descname"><span class="pre">get_regex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">headers</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">content</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">patterns</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/regex.html#get_regex"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.regex.get_regex" title="Link to this definition"></a></dt> <dd><p>Takes headers and content and gets regex matches</p> <dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>headers</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The headers to search</p></li> <li><p><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The content to search</p></li> <li><p><strong>patterns</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a><em>]</em>) – The regex patterns</p></li> </ul> </dd> <dt class="field-even">Returns<span class="colon">:</span></dt> <dd class="field-even"><p>A list of dicts, with selector, value, groups, position info, and source</p> </dd> <dt class="field-odd">Return type<span class="colon">:</span></dt> <dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)">list</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)">dict</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a> | <a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)">int</a>]]</p> </dd> </dl> </dd></dl> </section> <section id="module-mcp_server_webcrawl.extras.snippets"> <span id="mcp-server-webcrawl-extras-snippets-module"></span><h2>mcp_server_webcrawl.extras.snippets module<a class="headerlink" href="#module-mcp_server_webcrawl.extras.snippets" title="Link to this heading"></a></h2> <dl class="py class"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.snippets.SnippetContentExtractor"> <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SnippetContentExtractor</span></span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/snippets.html#SnippetContentExtractor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.snippets.SnippetContentExtractor" title="Link to this definition"></a></dt> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> <p>lxml-based HTML parser for extracting different types of content from HTML. Content separates into components: text, markup, attributes (values), and comments. These can be prioritized in search so that text is the displayed hit over noisier types.</p> <dl class="py attribute"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.snippets.SnippetContentExtractor.PRIORITY_ORDER"> <span class="sig-name descname"><span class="pre">PRIORITY_ORDER</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><span class="pre">list</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['url',</span> <span class="pre">'document_text',</span> <span class="pre">'document_attributes',</span> <span class="pre">'document_comments',</span> <span class="pre">'headers',</span> <span class="pre">'document_markup']</span></em><a class="headerlink" href="#mcp_server_webcrawl.extras.snippets.SnippetContentExtractor.PRIORITY_ORDER" title="Link to this definition"></a></dt> <dd></dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.snippets.SnippetContentExtractor.__init__"> <span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">headers</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">content</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/snippets.html#SnippetContentExtractor.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.snippets.SnippetContentExtractor.__init__" title="Link to this definition"></a></dt> <dd><dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – </p></li> <li><p><strong>headers</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – </p></li> <li><p><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – </p></li> </ul> </dd> </dl> </dd></dl> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.snippets.get_snippets"> <span class="sig-name descname"><span class="pre">get_snippets</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">headers</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">content</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">query</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/snippets.html#get_snippets"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.snippets.get_snippets" title="Link to this definition"></a></dt> <dd><p>Takes a query and content, reduces the HTML to text content and extracts hits as excerpts of text.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>headers</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – Header content to search</p></li> <li><p><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The HTML or text content to search in</p></li> <li><p><strong>query</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The search query string</p></li> <li><p><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – </p></li> </ul> </dd> <dt class="field-even">Returns<span class="colon">:</span></dt> <dd class="field-even"><p>A string of snippets with context around matched terms, separated by “ … “ or None</p> </dd> <dt class="field-odd">Return type<span class="colon">:</span></dt> <dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a> | None</p> </dd> </dl> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.snippets.find_snippets_in_text"> <span class="sig-name descname"><span class="pre">find_snippets_in_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">terms</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_snippets</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">15</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">group_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/snippets.html#find_snippets_in_text"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.snippets.find_snippets_in_text" title="Link to this definition"></a></dt> <dd><p>Searches for whole-word matches of the given terms in the text and extracts surrounding context to create highlighted snippets. Each snippet shows the matched term in context with markdown-style bold highlighting (<strong>term</strong>).</p> <dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>text</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The text to search within</p></li> <li><p><strong>terms</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a><em>]</em>) – List of search terms to find (case-insensitive, whole words only)</p></li> <li><p><strong>max_snippets</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a>) – Maximum number of snippets to return (default: MAX_SNIPPETS_MATCHED_COUNT)</p></li> <li><p><strong>group_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – Regex group identifier (reserved for future use)</p></li> </ul> </dd> <dt class="field-even">Returns<span class="colon">:</span></dt> <dd class="field-even"><p>List of unique snippet strings with matched terms highlighted using <strong>bold</strong> markdown. Each snippet includes surrounding context up to MAX_SNIPPETS_CONTEXT_SIZE characters on each side of the match. Returns empty list if no matches found or invalid input.</p> </dd> <dt class="field-odd">Return type<span class="colon">:</span></dt> <dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)">list</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a>]</p> </dd> </dl> </dd></dl> </section> <section id="module-mcp_server_webcrawl.extras.thumbnails"> <span id="mcp-server-webcrawl-extras-thumbnails-module"></span><h2>mcp_server_webcrawl.extras.thumbnails module<a class="headerlink" href="#module-mcp_server_webcrawl.extras.thumbnails" title="Link to this heading"></a></h2> <dl class="py class"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.thumbnails.ThumbnailManager"> <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ThumbnailManager</span></span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/thumbnails.html#ThumbnailManager"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.thumbnails.ThumbnailManager" title="Link to this definition"></a></dt> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p> <p>Manages thumbnail generation and caching for image files and URLs.</p> <dl class="py method"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.thumbnails.ThumbnailManager.__init__"> <span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/thumbnails.html#ThumbnailManager.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.thumbnails.ThumbnailManager.__init__" title="Link to this definition"></a></dt> <dd></dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.thumbnails.ThumbnailManager.get_thumbnails"> <span class="sig-name descname"><span class="pre">get_thumbnails</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/thumbnails.html#ThumbnailManager.get_thumbnails"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.thumbnails.ThumbnailManager.get_thumbnails" title="Link to this definition"></a></dt> <dd><p>Convert URLs or file paths to base64 encoded strings.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><p><strong>paths</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a><em>]</em>) – List of URLs or file paths to convert</p> </dd> <dt class="field-even">Returns<span class="colon">:</span></dt> <dd class="field-even"><p>Dictionary mapping paths to their base64 representation or None if failed</p> </dd> <dt class="field-odd">Return type<span class="colon">:</span></dt> <dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)">dict</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a> | None]</p> </dd> </dl> </dd></dl> </dd></dl> </section> <section id="module-mcp_server_webcrawl.extras.xpath"> <span id="mcp-server-webcrawl-extras-xpath-module"></span><h2>mcp_server_webcrawl.extras.xpath module<a class="headerlink" href="#module-mcp_server_webcrawl.extras.xpath" title="Link to this heading"></a></h2> <dl class="py function"> <dt class="sig sig-object py" id="mcp_server_webcrawl.extras.xpath.get_xpath"> <span class="sig-name descname"><span class="pre">get_xpath</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">content</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpaths</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mcp_server_webcrawl/extras/xpath.html#get_xpath"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#mcp_server_webcrawl.extras.xpath.get_xpath" title="Link to this definition"></a></dt> <dd><p>Takes content and gets xpath hits</p> <dl class="field-list simple"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – The HTML source</p></li> <li><p><strong>xpaths</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a><em>]</em>) – The xpath selectors</p></li> </ul> </dd> <dt class="field-even">Returns<span class="colon">:</span></dt> <dd class="field-even"><p>A list of dicts, with selector and value</p> </dd> <dt class="field-odd">Return type<span class="colon">:</span></dt> <dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.13)">list</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)">dict</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)">str</a> | <a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)">int</a> | <a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.13)">float</a>]]</p> </dd> </dl> </dd></dl> </section> <section id="module-mcp_server_webcrawl.extras"> <span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-mcp_server_webcrawl.extras" title="Link to this heading"></a></h2> </section> </section> </div> </div> <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> <a href="mcp_server_webcrawl.crawlers.wget.html" class="btn btn-neutral float-left" title="mcp_server_webcrawl.crawlers.wget package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> <a href="mcp_server_webcrawl.models.html" class="btn btn-neutral float-right" title="mcp_server_webcrawl.models package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> <hr/> <div role="contentinfo"> <p>&#169; Copyright 2025, pragmar.</p> </div> Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pragmar/mcp_server_webcrawl'

If you have feedback or need assistance with the MCP directory API, please join our Discord server