{
  "id": "task_libraries:html-parser/python",
  "path": "/exapedia/python-html-parser-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python HTML parser libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python HTML parser libraries turn HTML text into a tree of elements that code can search, read, and edit. A parser recovers from broken markup the way a browser does before a query API finds elements by CSS selector or XPath. These libraries let scrapers and AI agents pull text, links, and tables out of web pages."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python HTML parser libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#lxml",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#beautiful-soup",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F142"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#html-lib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F156"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F56"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#selectolax",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F81"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#parsel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scrapling",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyquery",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#requests-html",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F232"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#lxml",
          "label": [
            {
              "t": "text",
              "text": "lxml"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F129"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "CSS selector queries",
            "XPath queries"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#lxml",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#beautiful-soup",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F142"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#html-lib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F156"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#selectolax",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#parsel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scrapling",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyquery",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#requests-html",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F232"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "lxml",
          "name": [
            {
              "t": "fact",
              "fact": "F128"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/lxml/lxml"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/lxml"
            },
            {
              "label": "Docs",
              "href": "https://lxml.de/lxmlhtml.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://lxml.de/lxmlhtml.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/getnikola/nikola",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F140"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@_ConfigurableFilter(\n    xpath_list='HEADER_PERMALINKS_XPATH_LIST',\n    file_blacklist='HEADER_PERMALINKS_FILE_BLACKLIST',\n)\ndef add_header_permalinks(fname, xpath_list=None, file_blacklist=None):\n    \"\"\"Post-process HTML via lxml to add header permalinks Sphinx-style.\"\"\"\n    # Blacklist requires custom file handling\n    file_blacklist = file_blacklist or []\n    if fname in file_blacklist:\n        return\n    with io.open(fname, 'r', encoding='utf-8-sig') as inf:\n        data = inf.read()\n    doc = lxml.html.document_fromstring(data)\n    # Get language for slugify\n    try:\n        lang = doc.attrib['lang']  # <html lang=\"…\">\n    except KeyError:\n        # Circular import workaround (utils imports filters)\n        from nikola.utils import LocaleBorg\n\n        lang = LocaleBorg().current_lang\n\n    xpath_set = set()\n    if not xpath_list:\n        xpath_list = ['*//div[@class=\"e-content entry-content\"]//{hx}']\n    for xpath_expr in xpath_list:\n        for hx in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']:\n            xpath_set.add(xpath_expr.format(hx=hx))\n    for x in xpath_set:\n        nodes = doc.findall(x)\n        for node in nodes:\n            parent = node.getparent()\n            if 'id' in node.attrib:\n                hid = node.attrib['id']\n            elif 'id' in parent.attrib:\n                # docutils: <div> has an ID and contains the header\n                hid = parent.attrib['id']\n            else:\n                # Using force-mode, because not every character can appear in a\n                # HTML id\n                node.attrib['id'] = slugify(node.text_content(), lang, True)\n                hid = node.attrib['id']\n\n            new_node = lxml.html.fragment_fromstring(\n                '<a href=\"#{0}\" class=\"headerlink\" title=\"Permalink to this heading\">¶</a>'.format(\n                    hid\n                )\n            )\n            node.append(new_node)\n\n    with io.open(fname, 'w', encoding='utf-8') as outf:\n        outf.write('<!DOCTYPE html>\\n' + lxml.html.tostring(doc, encoding='unicode'))",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/getnikola/nikola/blob/b6931dc3122b1b37bbeeb0f0663f57833f911c09/nikola/filters.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F139"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20lxml%20for%20HTML%20parsing%20and%20element%20selection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from lxml import html\n\ndocument = html.fromstring(\"<h1>Hello</h1>\")\nprint(document.text_content())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://lxml.de/lxmlhtml.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "lxmlhtml.txt"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F133"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "beautiful-soup",
          "name": [
            {
              "t": "fact",
              "fact": "F142"
            }
          ],
          "links": [
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/beautifulsoup4"
            },
            {
              "label": "Docs",
              "href": "https://www.crummy.com/software/BeautifulSoup/bs4/doc/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F36"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.crummy.com/software/BeautifulSoup/bs4/doc/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F142"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/run-llama/llama_index",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _readthedocs_reader(soup: Any, url: str, **kwargs) -> Tuple[str, Dict[str, Any]]:\n    \"\"\"Extract text from a ReadTheDocs documentation site.\"\"\"\n    import requests\n    from bs4 import BeautifulSoup\n\n    links = soup.find_all(\"a\", {\"class\": \"reference internal\"})\n    rtd_links = []\n\n    for link in links:\n        rtd_links.append(link[\"href\"])\n    for i in range(len(rtd_links)):\n        if not rtd_links[i].startswith(\"http\"):\n            rtd_links[i] = urljoin(url, rtd_links[i])\n\n    texts = []\n    for doc_link in rtd_links:\n        page_link = requests.get(doc_link)\n        soup = BeautifulSoup(page_link.text, \"html.parser\")\n        try:\n            text = soup.find(attrs={\"role\": \"main\"}).get_text()\n\n        except IndexError:\n            text = None\n        if text:\n            texts.append(\"\\n\".join([t for t in text.split(\"\\n\") if t]))\n    return \"\\n\".join(texts), {}",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/run-llama/llama_index/blob/99d7433f6f71888951379ccca9294e272442c832/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/beautiful_soup_web/base.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F153"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20beautifulsoup4%20for%20HTML%20parsing%20and%20element%20selection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F142"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from bs4 import BeautifulSoup\n\ndocument = BeautifulSoup(\"<h1>Hello</h1>\", \"html.parser\")\nprint(document.h1.get_text())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.crummy.com/software/BeautifulSoup/bs4/doc/",
                  "label": [
                    {
                      "t": "text",
                      "text": "doc.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F147"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "html-lib",
          "name": [
            {
              "t": "fact",
              "fact": "F156"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/html5lib/html5lib-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/html5lib"
            },
            {
              "label": "Docs",
              "href": "https://html5lib.readthedocs.io/en/latest/html5lib.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F61"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F56"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://html5lib.readthedocs.io/en/latest/html5lib.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F156"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/getnikola/nikola",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@apply_to_text_file\ndef html5lib_minify(data):\n    \"\"\"Minify with html5lib.\"\"\"\n    import html5lib\n    import html5lib.serializer\n\n    data = html5lib.serializer.serialize(\n        html5lib.parse(data, treebuilder='lxml'),\n        tree='lxml',\n        quote_attr_values='spec',\n        omit_optional_tags=True,\n        minimize_boolean_attributes=True,\n        strip_whitespace=True,\n        alphabetical_attributes=True,\n        escape_lt_in_attrs=True,\n    )\n    return data",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/getnikola/nikola/blob/b6931dc3122b1b37bbeeb0f0663f57833f911c09/nikola/filters.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F167"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20html5lib%20for%20HTML%20parsing%20and%20element%20selection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F156"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import html5lib\n\ndocument = html5lib.parse(\"<h1>Hello</h1>\")\nprint(document.tag)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://html5lib.readthedocs.io/en/latest/html5lib.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F161"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "selectolax",
          "name": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/rushter/selectolax"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/selectolax"
            },
            {
              "label": "Docs",
              "href": "https://selectolax.readthedocs.io/en/latest/lexbor.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F87"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F81"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://selectolax.readthedocs.io/en/latest/lexbor.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F170"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F88"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F89"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F93"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/readthedocs/readthedocs.org",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _parse_dls(self, body):\n    # All terms in <dl>s are treated as sections.\n    # We traverse by <dl> - traversing by <dt> has shown in experiments to render a\n    # different traversal order, which could make the tests more unstable.\n    dls = body.css(\"dl\")\n\n    for dl in dls:\n        # Use an iterator to select immediate descendants.\n        dts = (node for node in dl.iter() if node.tag == \"dt\" and node.id)\n\n        # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt\n        # multiple <dt> elements in a row indicate several terms that are\n        # all defined by the immediate next <dd> element.\n        for dt in dts:\n            title, _id = self._parse_dt(dt)\n            dd = self._get_next_dd(dt)\n\n            # We only index a dt with an id attribute and an accompanying dd\n            if not dd or not _id:\n                continue\n\n            # Create a copy of the node to avoid manipulating the\n            # data structure that we're iterating over\n            dd_copy = LexborHTMLParser(dd.html).body.child\n\n            # Remove all nested domains from dd_copy.\n            # They are already parsed separately.\n            for node in dd_copy.css(\"dl\"):\n                # Traverse all <dt>s with an ID (the ones we index!)\n                for _dt in node.css('dt[id]:not([id=\"\"])'):\n                    # Fetch adjacent <dd>s and remove them\n                    _dd_dt = self._get_next_dd(_dt)\n                    if _dd_dt:\n                        _dd_dt.decompose()\n                    # Remove the <dt> too\n                    _dt.decompose()\n\n            # The content of the <dt> section is the content of the accompanying <dd>\n            content = self._parse_content(dd_copy.text())\n\n            yield (\n                dd,\n                dt,\n                {\n                    \"id\": _id,\n                    \"title\": title,\n                    \"content\": content,\n                },\n            )",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/readthedocs/readthedocs.org/blob/38dd30b02babe5890d38d2bb488f08cfeb97cf3c/readthedocs/search/parsers.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20selectolax%20for%20HTML%20parsing%20and%20element%20selection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F170"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from selectolax.lexbor import LexborHTMLParser\n\ndocument = LexborHTMLParser(\"<h1>Hello</h1>\")\nprint(document.css_first(\"h1\").text())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://selectolax.readthedocs.io/en/latest/lexbor.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F175"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "parsel",
          "name": [
            {
              "t": "fact",
              "fact": "F184"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/scrapy/parsel"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/parsel"
            },
            {
              "label": "Docs",
              "href": "https://parsel.readthedocs.io/en/latest/usage.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F191"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://parsel.readthedocs.io/en/latest/usage.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/apify/crawlee-python",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F198"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@override\ndef find_links(self, parsed_content: Selector, selector: str, attribute: str) -> Iterable[str]:\n    link: Selector\n    urls: list[str] = []\n    for link in parsed_content.css(selector):\n        url = link.xpath(f'@{attribute}').get()\n        if url:\n            urls.append(url.strip())\n    return urls",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/apify/crawlee-python/blob/db01ddcbf1cea39b6dbf08ec0b397eb68098d85d/src/crawlee/crawlers/_parsel/_parsel_parser.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=parsel%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from parsel import Selector\n\ndocument = Selector(text=\"<h1>Hello</h1>\")\nprint(document.css(\"h1::text\").get())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://parsel.readthedocs.io/en/latest/usage.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "usage.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F189"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "scrapling",
          "name": [
            {
              "t": "fact",
              "fact": "F200"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/D4Vinci/Scrapling"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/scrapling"
            },
            {
              "label": "Docs",
              "href": "https://scrapling.readthedocs.io/en/latest/parsing/selection/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://scrapling.readthedocs.io/en/latest/parsing/selection/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F200"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/byungjunjang/web-crawler",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F214"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def select_items(url, selector, heal=False):\n    storage = {\"storage_file\": \"./fingerprints/elements_storage.db\", \"url\": url}\n    try:\n        Path(\"./fingerprints\").mkdir(exist_ok=True)\n        page = plain_get(url, selector_config={\"adaptive\": True, \"storage_args\": storage})\n        return page.css(selector, adaptive=heal, auto_save=True)\n    except (OSError, sqlite3.Error) as exc:\n        logger.warning(f\"자가치유 저장소 사용 불가, 일반 셀렉터로 계속: {exc}\")\n        page = plain_get(url, selector_config={\"adaptive\": False})\n        return page.css(selector)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/byungjunjang/web-crawler/blob/bbca7cad38b5efb5dd3f72cd1c10075efe6c637a/scripts/scrapling_reference.md",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=scrapling%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F200"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from scrapling.parser import Selector\n\ndocument = Selector(\"<h1>Hello</h1>\")\nprint(document.css(\"h1::text\").get())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/D4Vinci/Scrapling/contents/scrapling/parser.py?ref=v0.5.1",
                  "label": [
                    {
                      "t": "text",
                      "text": "parser.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F205"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyquery",
          "name": [
            {
              "t": "fact",
              "fact": "F216"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/gawel/pyquery"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyquery"
            },
            {
              "label": "Docs",
              "href": "https://pyquery.readthedocs.io/en/latest/api.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F223"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pyquery.readthedocs.io/en/latest/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F216"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/mozilla/kitsune",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F230"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def redirect_url(self, source_locale=settings.LANGUAGE_CODE):\n    \"\"\"If I am a redirect, return the URL to which I redirect.\n\n    Otherwise, return None.\n\n    \"\"\"\n    # If a document starts with REDIRECT_HTML and contains any <a> tags\n    # with hrefs, return the href of the first one. This trick saves us\n    # from having to parse the HTML every time.\n    if self.is_redirect:\n        anchors = PyQuery(self.html)(\"a[href]\")\n        if anchors:\n            # Articles with a redirect have a link that has the locale\n            # hardcoded into it, and so by simply redirecting to the given\n            # link, we end up possibly losing the locale. So, instead,\n            # we strip out the locale and replace it with the original\n            # source locale only in the case where an article is going\n            # from one locale and redirecting it to a different one.\n            # This only applies when it's a non-default locale because we\n            # don't want to override the redirects that are forcibly\n            # changing to (or staying within) a specific locale.\n            full_url = anchors[0].get(\"href\")\n            (dest_locale, url) = split_into_language_and_path(full_url)\n            if source_locale != dest_locale and dest_locale == settings.LANGUAGE_CODE:\n                return f\"/{source_locale}{url}\"\n            return full_url",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/mozilla/kitsune/blob/d19fcdd98bb78863331b3c80f2a2dee880fcee9a/kitsune/wiki/models.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pyquery%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F216"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pyquery import PyQuery\n\ndocument = PyQuery(\"<h1>Hello</h1>\")\nprint(document(\"h1\").text())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/gawel/pyquery/contents/pyquery/pyquery.py?ref=2.1.0",
                  "label": [
                    {
                      "t": "text",
                      "text": "pyquery.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "requests-html",
          "name": [
            {
              "t": "fact",
              "fact": "F232"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/psf/requests-html"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/requests-html"
            },
            {
              "label": "Docs",
              "href": "https://requests.readthedocs.io/projects/requests-html/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F239"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://requests.readthedocs.io/projects/requests-html/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F232"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/pyenv/pyenv",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def main() -> bool:\n    html_session = HTMLSession()\n    response = html_session.get(PYPY_CHECKSUMS)\n    page = response.html\n    checksum_blocks = page.find(\"pre.literal-block\")\n    for csum_block in checksum_blocks:\n        python_version, pypy_version = parse_pypy_ver(csum_block.text)\n        py_it = f\"pypy{python_version}-{pypy_version}\"\n        if py_it not in EXCLUDED_RELEASES:\n            vbin_path = OUT_DIR.joinpath(py_it)\n            vsrc_path = OUT_DIR.joinpath(py_it+\"-src\")\n\n            kwargs = None\n            for ps in ((vbin_path, SCRIPT_BIN), (vsrc_path, SCRIPT_SRC)):\n                if not ps[0].is_file():\n                    kwargs = kwargs or parse_checksums_ext(csum_block.text)\n                    code = ps[1].format(\n                            version_pypy=pypy_version,\n                            version_python=python_version,\n                            ensurepip=\"ensurepip\" if not python_version == \"2.7\" else \"ensurepip_lt21\",\n                            **kwargs  # which are:\n                                      # checksum_aarch64\n                                      # checksum_linux32\n                                      # checksum_linux64\n                                      # checksum_osarm64\n                                      # checksum_osx64\n                                      # checksum_src\n                                      # file_ext\n                        )\n                    if not args.dry_run:\n                        with open(file=ps[0], mode=\"w\", encoding=\"utf-8\") as f:\n                            f.write(code)\n                            f.close()\n                    else:\n                        print(f\"---- DRY RUN SCRIPT FOR {ps[0]} ----\")\n                        print(code)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/pyenv/pyenv/blob/186b350c853042c5b943df053fe1b99a7c81e5a3/plugins/python-build/scripts/add_pypy.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F245"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=requests-html%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F232"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from requests_html import HTML\n\ndocument = HTML(html=\"<h1>Hello</h1>\")\nprint(document.find(\"h1\", first=True).text)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/psf/requests-html/contents/requests_html.py?ref=v0.10.0",
                  "label": [
                    {
                      "t": "text",
                      "text": "requests_html.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F237"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python HTML parser should I use?",
      "a": [
        {
          "t": "link",
          "href": "#beautiful-soup",
          "label": [
            {
              "t": "text",
              "text": "Beautiful Soup"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits most scraping, with tag navigation over a choice of parser backends. "
        },
        {
          "t": "link",
          "href": "#lxml",
          "label": [
            {
              "t": "text",
              "text": "lxml"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits fast parsing with full XPath. "
        },
        {
          "t": "link",
          "href": "#selectolax",
          "label": [
            {
              "t": "text",
              "text": "selectolax"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits high-volume parsing with CSS selectors."
        }
      ]
    },
    {
      "q": "What is Beautiful Soup?",
      "a": [
        {
          "t": "link",
          "href": "#beautiful-soup",
          "label": [
            {
              "t": "text",
              "text": "Beautiful Soup"
            }
          ]
        },
        {
          "t": "text",
          "text": " searches, navigates, and modifies HTML through a parser backend such as the built-in html.parser, lxml, or "
        },
        {
          "t": "link",
          "href": "#html-lib",
          "label": [
            {
              "t": "fact",
              "fact": "F156"
            }
          ]
        },
        {
          "t": "text",
          "text": ". The backend decides how it recovers from broken markup."
        }
      ]
    },
    {
      "q": "What is Scrapling?",
      "a": [
        {
          "t": "link",
          "href": "#scrapling",
          "label": [
            {
              "t": "text",
              "text": "Scrapling"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a web scraping framework with CSS and XPath extraction. It can relocate elements after a page layout changes by matching their structure."
        }
      ]
    },
    {
      "q": "Beautiful Soup vs lxml: which should I use?",
      "a": [
        {
          "t": "link",
          "href": "#lxml",
          "label": [
            {
              "t": "text",
              "text": "lxml"
            }
          ]
        },
        {
          "t": "text",
          "text": " parses quickly and supports full XPath and element editing. "
        },
        {
          "t": "link",
          "href": "#beautiful-soup",
          "label": [
            {
              "t": "text",
              "text": "Beautiful Soup"
            }
          ]
        },
        {
          "t": "text",
          "text": " offers a friendlier search API and can use lxml as its parser backend."
        }
      ]
    },
    {
      "q": "What is selectolax?",
      "a": [
        {
          "t": "link",
          "href": "#selectolax",
          "label": [
            {
              "t": "text",
              "text": "selectolax"
            }
          ]
        },
        {
          "t": "text",
          "text": " parses HTML with the Lexbor engine and queries the tree with CSS selectors. It has no full XPath evaluator."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, lxml",
      "display": "lxml",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, lxml",
      "display": "430.9M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, lxml",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, lxml",
      "display": "6.1.3, Sep 2026",
      "asOf": "2026-09-02"
    },
    "F5": {
      "label": "Package release date, lxml",
      "display": "Sep 2026",
      "asOf": "2026-09-02"
    },
    "F6": {
      "label": "Repository stars, lxml",
      "display": "3.1K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "CSS selectors, lxml",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Browser-style parsing, lxml",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "HTML fragments, lxml",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Output formats, lxml",
      "display": "HTML",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, lxml",
      "display": "pip install lxml",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, lxml",
      "display": "Parses HTML into ElementTree-compatible elements with XPath and HTML-specific methods.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, lxml",
      "display": "Selects elements with XPath",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, lxml",
      "display": "Query the parsed tree using XPath expressions.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, lxml",
      "display": "Parses fragments as separate elements",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, lxml",
      "display": "Use fragments_fromstring when input contains multiple top-level elements.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, lxml",
      "display": "CSS selectors need another package",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, lxml",
      "display": "Install cssselect before using lxml.cssselect.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, lxml",
      "display": "Recovery risks missing content",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, lxml",
      "display": "Validate extracted content before trusting heavily malformed input.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, lxml",
      "display": "from lxml.html import fromstring, tostring\n\nform_page = fromstring('''<html><body><form>\n  Your name: <input type=\"text\" name=\"name\"> <br>\n  Your phone: <input type=\"text\" name=\"phone\"> <br>\n  Your favorite pets: <br>\n  Dogs: <input type=\"checkbox\" name=\"interest\" value=\"dogs\"> <br>\n  Cats: <input type=\"checkbox\" name=\"interest\" value=\"cats\"> <br>\n  Llamas: <input type=\"checkbox\" name=\"interest\" value=\"llamas\"> <br>\n  <input type=\"submit\"></form></body></html>''')\n\nform = form_page.forms[0]\n\nform.fields = dict(\n    name='John Smith',\n    phone='555-555-3949',\n    interest=set(['cats', 'llamas']))\n\nprint(tostring(form))\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, lxml",
      "display": "@_ConfigurableFilter(\n    xpath_list='HEADER_PERMALINKS_XPATH_LIST',\n    file_blacklist='HEADER_PERMALINKS_FILE_BLACKLIST',\n)\ndef add_header_permalinks(fname, xpath_list=None, file_blacklist=None):\n    \"\"\"Post-process HTML via lxml to add header permalinks Sphinx-style.\"\"\"\n    # Blacklist requires custom file handling\n    file_blacklist = file_blacklist or []\n    if fname in file_blacklist:\n        return\n    with io.open(fname, 'r', encoding='utf-8-sig') as inf:\n        data = inf.read()\n    doc = lxml.html.document_fromstring(data)\n    # Get language for slugify\n    try:\n        lang = doc.attrib['lang']  # <html lang=\"…\">\n    except KeyError:\n        # Circular import workaround (utils imports filters)\n        from nikola.utils import LocaleBorg\n\n        lang = LocaleBorg().current_lang\n\n    xpath_set = set()\n    if not xpath_list:\n        xpath_list = ['*//div[@class=\"e-content entry-content\"]//{hx}']\n    for xpath_expr in xpath_list:\n        for hx in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']:\n            xpath_set.add(xpath_expr.format(hx=hx))\n    for x in xpath_set:\n        nodes = doc.findall(x)\n        for node in nodes:\n            parent = node.getparent()\n            if 'id' in node.attrib:\n                hid = node.attrib['id']\n            elif 'id' in parent.attrib:\n                # docutils: <div> has an ID and contains the header\n                hid = parent.attrib['id']\n            else:\n                # Using force-mode, because not every character can appear in a\n                # HTML id\n                node.attrib['id'] = slugify(node.text_content(), lang, True)\n                hid = node.attrib['id']\n\n            new_node = lxml.html.fragment_fromstring(\n                '<a href=\"#{0}\" class=\"headerlink\" title=\"Permalink to this heading\">¶</a>'.format(\n                    hid\n                )\n            )\n            node.append(new_node)\n\n    with io.open(fname, 'w', encoding='utf-8') as outf:\n        outf.write('<!DOCTYPE html>\\n' + lxml.html.tostring(doc, encoding='unicode'))\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, lxml",
      "display": "filters.py · add_header_permalinks()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, lxml",
      "display": "getnikola/nikola",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, getnikola/nikola",
      "display": "2.7K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, getnikola/nikola",
      "display": "Nov 2026",
      "asOf": "2026-11-09"
    },
    "F27": {
      "label": "Library name, beautifulsoup4",
      "display": "Beautiful Soup",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, beautifulsoup4",
      "display": "310.7M",
      "asOf": "2026-11-16"
    },
    "F29": {
      "label": "License, beautifulsoup4",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, beautifulsoup4",
      "display": "4.15.0, Jun 2026",
      "asOf": "2026-06-07"
    },
    "F31": {
      "label": "Package release date, beautifulsoup4",
      "display": "Jun 2026",
      "asOf": "2026-06-07"
    },
    "F32": {
      "label": "CSS selectors, beautifulsoup4",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Browser-style parsing, beautifulsoup4",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Output formats, beautifulsoup4",
      "display": "HTML, XML",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Install, beautifulsoup4",
      "display": "pip install beautifulsoup4",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "What it does, beautifulsoup4",
      "display": "Searches, navigates, and modifies HTML through a selected parser backend.",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths lead, beautifulsoup4",
      "display": "Combines tag searches with CSS",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths, beautifulsoup4",
      "display": "Use find_all and CSS selectors on the same parsed tree.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, beautifulsoup4",
      "display": "Retains source positions",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, beautifulsoup4",
      "display": "Read sourceline and sourcepos with html.parser or html5lib.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations lead, beautifulsoup4",
      "display": "Parser choice changes broken trees",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations, beautifulsoup4",
      "display": "Choose a parser explicitly for consistent malformed-HTML handling.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, beautifulsoup4",
      "display": "Partial parsing excludes html5lib",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, beautifulsoup4",
      "display": "SoupStrainer cannot skip input when using the html5lib backend.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Quickstart, beautifulsoup4",
      "display": "html_doc = \"\"\"<html><head><title>The Dormouse's story</title></head>\n<body>\n<p class=\"title\"><b>The Dormouse's story</b></p>\n\n<p class=\"story\">Once upon a time there were three little sisters; and their names were\n<a href=\"http://example.com/elsie\" class=\"sister\" id=\"link1\">Elsie</a>,\n<a href=\"http://example.com/lacie\" class=\"sister\" id=\"link2\">Lacie</a> and\n<a href=\"http://example.com/tillie\" class=\"sister\" id=\"link3\">Tillie</a>;\nand they lived at the bottom of a well.</p>\n\n<p class=\"story\">...</p>\n\"\"\"\n\n\nfrom bs4 import BeautifulSoup\nsoup = BeautifulSoup(html_doc, 'html.parser')\n\nprint(soup.prettify())\n\nfor link in soup.find_all('a'):\n    print(link.get('href'))\n",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project function, beautifulsoup4",
      "display": "def _readthedocs_reader(soup: Any, url: str, **kwargs) -> Tuple[str, Dict[str, Any]]:\n    \"\"\"Extract text from a ReadTheDocs documentation site.\"\"\"\n    import requests\n    from bs4 import BeautifulSoup\n\n    links = soup.find_all(\"a\", {\"class\": \"reference internal\"})\n    rtd_links = []\n\n    for link in links:\n        rtd_links.append(link[\"href\"])\n    for i in range(len(rtd_links)):\n        if not rtd_links[i].startswith(\"http\"):\n            rtd_links[i] = urljoin(url, rtd_links[i])\n\n    texts = []\n    for doc_link in rtd_links:\n        page_link = requests.get(doc_link)\n        soup = BeautifulSoup(page_link.text, \"html.parser\")\n        try:\n            text = soup.find(attrs={\"role\": \"main\"}).get_text()\n\n        except IndexError:\n            text = None\n        if text:\n            texts.append(\"\\n\".join([t for t in text.split(\"\\n\") if t]))\n    return \"\\n\".join(texts), {}\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function reference, beautifulsoup4",
      "display": "base.py · _readthedocs_reader()",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project repository, beautifulsoup4",
      "display": "run-llama/llama_index",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project stars, run-llama/llama_index",
      "display": "52.9K",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project push date, run-llama/llama_index",
      "display": "Nov 2026",
      "asOf": "2026-11-14"
    },
    "F51": {
      "label": "Library name, html5lib",
      "display": "html5lib",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Monthly downloads, html5lib",
      "display": "28.9M",
      "asOf": "2026-11-16"
    },
    "F53": {
      "label": "License, html5lib",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Package release, html5lib",
      "display": "1.1, Jun 2020",
      "asOf": "2020-06-22"
    },
    "F55": {
      "label": "Package release date, html5lib",
      "display": "Jun 2020",
      "asOf": "2020-06-22"
    },
    "F56": {
      "label": "Repository stars, html5lib",
      "display": "1.2K",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Browser-style parsing, html5lib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "HTML fragments, html5lib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Output formats, html5lib",
      "display": "HTML",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Install, html5lib",
      "display": "pip install html5lib",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "What it does, html5lib",
      "display": "Builds HTML trees using WHATWG parsing and browser-compatible error recovery.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths lead, html5lib",
      "display": "Uses browser-style error recovery",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths, html5lib",
      "display": "Parse malformed HTML using the HTML specification’s recovery rules.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, html5lib",
      "display": "Can reject parse errors",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, html5lib",
      "display": "Set strict=True to raise exceptions on parse errors.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "limitations lead, html5lib",
      "display": "lxml trees lose some nodes",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations, html5lib",
      "display": "Root-level text or comments trigger DataLossWarning with the lxml tree builder.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, html5lib",
      "display": "lxml trees exclude PyPy",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, html5lib",
      "display": "Choose another tree backend when running on PyPy.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Quickstart, html5lib",
      "display": "import html5lib\nwith open(\"mydocument.html\", \"rb\") as f:\n    parser = html5lib.HTMLParser(strict=True)\n    document = parser.parse(f)\n\n",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project function, html5lib",
      "display": "@apply_to_text_file\ndef html5lib_minify(data):\n    \"\"\"Minify with html5lib.\"\"\"\n    import html5lib\n    import html5lib.serializer\n\n    data = html5lib.serializer.serialize(\n        html5lib.parse(data, treebuilder='lxml'),\n        tree='lxml',\n        quote_attr_values='spec',\n        omit_optional_tags=True,\n        minimize_boolean_attributes=True,\n        strip_whitespace=True,\n        alphabetical_attributes=True,\n        escape_lt_in_attrs=True,\n    )\n    return data\n",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project function reference, html5lib",
      "display": "filters.py · html5lib_minify()",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project repository, html5lib",
      "display": "getnikola/nikola",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project stars, getnikola/nikola",
      "display": "2.7K",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project push date, getnikola/nikola",
      "display": "Nov 2026",
      "asOf": "2026-11-09"
    },
    "F76": {
      "label": "Library name, selectolax",
      "display": "Selectolax",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Monthly downloads, selectolax",
      "display": "6.2M",
      "asOf": "2026-11-16"
    },
    "F78": {
      "label": "License, selectolax",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Package release, selectolax",
      "display": "1.0.2, Oct 2026",
      "asOf": "2026-10-22"
    },
    "F80": {
      "label": "Package release date, selectolax",
      "display": "Oct 2026",
      "asOf": "2026-10-22"
    },
    "F81": {
      "label": "Repository stars, selectolax",
      "display": "1.7K",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "CSS selectors, selectolax",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Browser-style parsing, selectolax",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "HTML fragments, selectolax",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Output formats, selectolax",
      "display": "HTML",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Install, selectolax",
      "display": "pip install selectolax",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "What it does, selectolax",
      "display": "Parses HTML with Lexbor and queries its tree using CSS selectors.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths lead, selectolax",
      "display": "Queries with complex CSS",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths, selectolax",
      "display": "Use compound selectors to target matching nested elements.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths lead, selectolax",
      "display": "Parses fragments without document wrappers",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths, selectolax",
      "display": "Set is_fragment=True to avoid inserting synthetic document elements.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "limitations lead, selectolax",
      "display": "Template contents need separate traversal",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations, selectolax",
      "display": "Use template_fragments; ordinary css queries skip template contents.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Quickstart, selectolax",
      "display": "from selectolax.lexbor import LexborHTMLParser\n\nhtml = \"\"\"\n<h1 id=\"title\" data-updated=\"20201101\">Hi there</h1>\n<div class=\"post\">Lorem Ipsum is simply dummy text of the printing and typesetting industry. </div>\n<div class=\"post\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>\n\"\"\"\ntree = LexborHTMLParser(html)\n\nprint(tree.css_first('h1#title').text())\n# 'Hi there'\n\nprint(tree.css_first('h1#title').attributes)\n# {'id': 'title', 'data-updated': '20201101'}\n\nprint([node.text() for node in tree.css('.post')])\n# ['Lorem Ipsum is simply dummy text of the printing and typesetting industry. ',\n#  'Lorem ipsum dolor sit amet, consectetur adipiscing elit.']\n",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Project function, selectolax",
      "display": "def _parse_dls(self, body):\n    # All terms in <dl>s are treated as sections.\n    # We traverse by <dl> - traversing by <dt> has shown in experiments to render a\n    # different traversal order, which could make the tests more unstable.\n    dls = body.css(\"dl\")\n\n    for dl in dls:\n        # Use an iterator to select immediate descendants.\n        dts = (node for node in dl.iter() if node.tag == \"dt\" and node.id)\n\n        # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt\n        # multiple <dt> elements in a row indicate several terms that are\n        # all defined by the immediate next <dd> element.\n        for dt in dts:\n            title, _id = self._parse_dt(dt)\n            dd = self._get_next_dd(dt)\n\n            # We only index a dt with an id attribute and an accompanying dd\n            if not dd or not _id:\n                continue\n\n            # Create a copy of the node to avoid manipulating the\n            # data structure that we're iterating over\n            dd_copy = LexborHTMLParser(dd.html).body.child\n\n            # Remove all nested domains from dd_copy.\n            # They are already parsed separately.\n            for node in dd_copy.css(\"dl\"):\n                # Traverse all <dt>s with an ID (the ones we index!)\n                for _dt in node.css('dt[id]:not([id=\"\"])'):\n                    # Fetch adjacent <dd>s and remove them\n                    _dd_dt = self._get_next_dd(_dt)\n                    if _dd_dt:\n                        _dd_dt.decompose()\n                    # Remove the <dt> too\n                    _dt.decompose()\n\n            # The content of the <dt> section is the content of the accompanying <dd>\n            content = self._parse_content(dd_copy.text())\n\n            yield (\n                dd,\n                dt,\n                {\n                    \"id\": _id,\n                    \"title\": title,\n                    \"content\": content,\n                },\n            )\n",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project function reference, selectolax",
      "display": "parsers.py · _parse_dls()",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project repository, selectolax",
      "display": "readthedocs/readthedocs.org",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Project stars, readthedocs/readthedocs.org",
      "display": "8.4K",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Project push date, readthedocs/readthedocs.org",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F100": {
      "label": "Developer need",
      "display": "Combining tag search with CSS",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Why choose beautifulsoup4",
      "display": "tag searches and CSS on one tree",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need in introduction",
      "display": "combining tag search with CSS",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need",
      "display": "Querying with XPath",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Why choose lxml",
      "display": "native XPath element queries",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need in introduction",
      "display": "querying with XPath",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "When to consider html5lib",
      "display": "browser-style parse recovery is the deciding requirement",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need",
      "display": "Parsing fragments without added document elements",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Why choose selectolax",
      "display": "explicit fragment parsing mode",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need in introduction",
      "display": "parsing fragments without added document elements",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "When to consider beautifulsoup4",
      "display": "Beautiful Soup tag-search methods fit the extraction",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need",
      "display": "Reproducing browser-style parse recovery",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Why choose html5lib",
      "display": "WHATWG error recovery",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Developer need in introduction",
      "display": "reproducing browser-style parse recovery",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Page introduction",
      "display": "Python HTML parser libraries let developers read and select content from HTML documents.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Why do two parsers return different HTML trees?",
      "display": "Malformed HTML can produce different parse trees under different Beautiful Soup parser backends.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Does Beautiful Soup include an HTML parser?",
      "display": "It relies on parser backends rather than including parsing code itself.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does Beautiful Soup need a separate CSS selector installation?",
      "display": "A normal pip installation also installs Soup Sieve, which implements its CSS selectors.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does lxml include its CSS selector dependency?",
      "display": "cssselect is an independent package; installing it lets lxml use CSS selection.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Can lxml use browser-style parsing?",
      "display": "Its html5parser integration uses the external html5lib parser.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can lxml recover every part of broken HTML?",
      "display": "Its recovery parser does not guarantee that every part of the original document survives.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: How does lxml parse more than one top-level fragment?",
      "display": "fragments_fromstring returns the elements found in a fragment.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Why does a Selectolax CSS query miss template contents?",
      "display": "Template contents are separate from the document tree; template_fragments exposes them for querying.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: How does Selectolax fragment mode differ from full-document parsing?",
      "display": "With is_fragment=True, it parses a fragment without inserting required document elements.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can strict mode stop parsing on invalid markup?",
      "display": "Its strict parser mode raises an exception when a parse error occurs.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Does the lxml tree backend preserve every node?",
      "display": "The lxml backend cannot represent some trees, including text or comments beside the root.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Does the lxml tree backend preserve every node?",
      "display": "Those cases emit DataLossWarning.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does Beautiful Soup partial parsing work with every backend?",
      "display": "The html5lib backend always parses the whole document, ignoring the intended partial-parser optimization.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "Library name, lxml",
      "display": "lxml",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Monthly downloads, lxml",
      "display": "448.3M",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "License, lxml",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Package release, lxml",
      "display": "6.1.3",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Package release date, lxml",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Install, lxml",
      "display": "python3.13 -m pip install lxml==6.1.3",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Quickstart, lxml",
      "display": "from lxml import html\n\ndocument = html.fromstring(\"<h1>Hello</h1>\")\nprint(document.text_content())\n",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "CSS selector queries, lxml",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "XPath queries, lxml",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Parsing/query model, lxml",
      "display": "HTML/XML trees with full XPath, serialization, and element editing; optional cssselect supplies CSS queries.",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Project function, lxml",
      "display": "@_ConfigurableFilter(\n    xpath_list='HEADER_PERMALINKS_XPATH_LIST',\n    file_blacklist='HEADER_PERMALINKS_FILE_BLACKLIST',\n)\ndef add_header_permalinks(fname, xpath_list=None, file_blacklist=None):\n    \"\"\"Post-process HTML via lxml to add header permalinks Sphinx-style.\"\"\"\n    # Blacklist requires custom file handling\n    file_blacklist = file_blacklist or []\n    if fname in file_blacklist:\n        return\n    with io.open(fname, 'r', encoding='utf-8-sig') as inf:\n        data = inf.read()\n    doc = lxml.html.document_fromstring(data)\n    # Get language for slugify\n    try:\n        lang = doc.attrib['lang']  # <html lang=\"…\">\n    except KeyError:\n        # Circular import workaround (utils imports filters)\n        from nikola.utils import LocaleBorg\n\n        lang = LocaleBorg().current_lang\n\n    xpath_set = set()\n    if not xpath_list:\n        xpath_list = ['*//div[@class=\"e-content entry-content\"]//{hx}']\n    for xpath_expr in xpath_list:\n        for hx in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']:\n            xpath_set.add(xpath_expr.format(hx=hx))\n    for x in xpath_set:\n        nodes = doc.findall(x)\n        for node in nodes:\n            parent = node.getparent()\n            if 'id' in node.attrib:\n                hid = node.attrib['id']\n            elif 'id' in parent.attrib:\n                # docutils: <div> has an ID and contains the header\n                hid = parent.attrib['id']\n            else:\n                # Using force-mode, because not every character can appear in a\n                # HTML id\n                node.attrib['id'] = slugify(node.text_content(), lang, True)\n                hid = node.attrib['id']\n\n            new_node = lxml.html.fragment_fromstring(\n                '<a href=\"#{0}\" class=\"headerlink\" title=\"Permalink to this heading\">¶</a>'.format(\n                    hid\n                )\n            )\n            node.append(new_node)\n\n    with io.open(fname, 'w', encoding='utf-8') as outf:\n        outf.write('<!DOCTYPE html>\\n' + lxml.html.tostring(doc, encoding='unicode'))",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Project source file, lxml",
      "display": "nikola/filters.py",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Project full_name, lxml",
      "display": "getnikola/nikola",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Project stargazers_count, lxml",
      "display": "2.7K",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Library name, beautifulsoup4",
      "display": "Beautiful Soup",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Monthly downloads, beautifulsoup4",
      "display": "322.6M",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "License, beautifulsoup4",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Package release, beautifulsoup4",
      "display": "4.15.0",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Package release date, beautifulsoup4",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Install, beautifulsoup4",
      "display": "python3.13 -m pip install beautifulsoup4==4.15.0",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Quickstart, beautifulsoup4",
      "display": "from bs4 import BeautifulSoup\n\ndocument = BeautifulSoup(\"<h1>Hello</h1>\", \"html.parser\")\nprint(document.h1.get_text())\n",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "CSS selector queries, beautifulsoup4",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "XPath queries, beautifulsoup4",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Parsing/query model, beautifulsoup4",
      "display": "Tag-oriented navigation/search and integrated SoupSieve CSS queries over selectable parser backends; choosing a backend changes broken-markup recovery.",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Project function, beautifulsoup4",
      "display": "def _readthedocs_reader(soup: Any, url: str, **kwargs) -> Tuple[str, Dict[str, Any]]:\n    \"\"\"Extract text from a ReadTheDocs documentation site.\"\"\"\n    import requests\n    from bs4 import BeautifulSoup\n\n    links = soup.find_all(\"a\", {\"class\": \"reference internal\"})\n    rtd_links = []\n\n    for link in links:\n        rtd_links.append(link[\"href\"])\n    for i in range(len(rtd_links)):\n        if not rtd_links[i].startswith(\"http\"):\n            rtd_links[i] = urljoin(url, rtd_links[i])\n\n    texts = []\n    for doc_link in rtd_links:\n        page_link = requests.get(doc_link)\n        soup = BeautifulSoup(page_link.text, \"html.parser\")\n        try:\n            text = soup.find(attrs={\"role\": \"main\"}).get_text()\n\n        except IndexError:\n            text = None\n        if text:\n            texts.append(\"\\n\".join([t for t in text.split(\"\\n\") if t]))\n    return \"\\n\".join(texts), {}",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Project source file, beautifulsoup4",
      "display": "llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/beautiful_soup_web/base.py",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Project full_name, beautifulsoup4",
      "display": "run-llama/llama_index",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Project stargazers_count, beautifulsoup4",
      "display": "52.9K",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Library name, html5lib",
      "display": "html5lib",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Monthly downloads, html5lib",
      "display": "30.4M",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "License, html5lib",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Package release, html5lib",
      "display": "1.1",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Package release date, html5lib",
      "display": "Jun 2020",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Install, html5lib",
      "display": "python3.13 -m pip install html5lib==1.1",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Quickstart, html5lib",
      "display": "import html5lib\n\ndocument = html5lib.parse(\"<h1>Hello</h1>\")\nprint(document.tag)\n",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "CSS selector queries, html5lib",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "XPath queries, html5lib",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Parsing/query model, html5lib",
      "display": "WHATWG HTML parsing/recovery with selectable ElementTree, DOM, or optional lxml tree builders; namespace behavior matters for downstream queries.",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project function, html5lib",
      "display": "@apply_to_text_file\ndef html5lib_minify(data):\n    \"\"\"Minify with html5lib.\"\"\"\n    import html5lib\n    import html5lib.serializer\n\n    data = html5lib.serializer.serialize(\n        html5lib.parse(data, treebuilder='lxml'),\n        tree='lxml',\n        quote_attr_values='spec',\n        omit_optional_tags=True,\n        minimize_boolean_attributes=True,\n        strip_whitespace=True,\n        alphabetical_attributes=True,\n        escape_lt_in_attrs=True,\n    )\n    return data",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Project source file, html5lib",
      "display": "nikola/filters.py",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Project full_name, html5lib",
      "display": "getnikola/nikola",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Project stargazers_count, html5lib",
      "display": "2.7K",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Library name, selectolax",
      "display": "selectolax",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Monthly downloads, selectolax",
      "display": "6.5M",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "License, selectolax",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Package release, selectolax",
      "display": "1.0.2",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Package release date, selectolax",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Install, selectolax",
      "display": "python3.13 -m pip install selectolax==1.0.2",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Quickstart, selectolax",
      "display": "from selectolax.lexbor import LexborHTMLParser\n\ndocument = LexborHTMLParser(\"<h1>Hello</h1>\")\nprint(document.css_first(\"h1\").text())\n",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "CSS selector queries, selectolax",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "XPath queries, selectolax",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Parsing/query model, selectolax",
      "display": "Lexbor HTML5 tree parsing, CSS queries, and node editing; no full XPath evaluator. Give worker threads separate parser objects, especially on free-threaded Python.",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project function, selectolax",
      "display": "def _parse_dls(self, body):\n    # All terms in <dl>s are treated as sections.\n    # We traverse by <dl> - traversing by <dt> has shown in experiments to render a\n    # different traversal order, which could make the tests more unstable.\n    dls = body.css(\"dl\")\n\n    for dl in dls:\n        # Use an iterator to select immediate descendants.\n        dts = (node for node in dl.iter() if node.tag == \"dt\" and node.id)\n\n        # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt\n        # multiple <dt> elements in a row indicate several terms that are\n        # all defined by the immediate next <dd> element.\n        for dt in dts:\n            title, _id = self._parse_dt(dt)\n            dd = self._get_next_dd(dt)\n\n            # We only index a dt with an id attribute and an accompanying dd\n            if not dd or not _id:\n                continue\n\n            # Create a copy of the node to avoid manipulating the\n            # data structure that we're iterating over\n            dd_copy = LexborHTMLParser(dd.html).body.child\n\n            # Remove all nested domains from dd_copy.\n            # They are already parsed separately.\n            for node in dd_copy.css(\"dl\"):\n                # Traverse all <dt>s with an ID (the ones we index!)\n                for _dt in node.css('dt[id]:not([id=\"\"])'):\n                    # Fetch adjacent <dd>s and remove them\n                    _dd_dt = self._get_next_dd(_dt)\n                    if _dd_dt:\n                        _dd_dt.decompose()\n                    # Remove the <dt> too\n                    _dt.decompose()\n\n            # The content of the <dt> section is the content of the accompanying <dd>\n            content = self._parse_content(dd_copy.text())\n\n            yield (\n                dd,\n                dt,\n                {\n                    \"id\": _id,\n                    \"title\": title,\n                    \"content\": content,\n                },\n            )",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project source file, selectolax",
      "display": "readthedocs/search/parsers.py",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project full_name, selectolax",
      "display": "readthedocs/readthedocs.org",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project stargazers_count, selectolax",
      "display": "8.4K",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Library name, parsel",
      "display": "parsel",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Monthly downloads, parsel",
      "display": "3.8M",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "License, parsel",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Package release, parsel",
      "display": "1.12.1",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Package release date, parsel",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Install, parsel",
      "display": "python3.13 -m pip install parsel==1.12.1",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Quickstart, parsel",
      "display": "from parsel import Selector\n\ndocument = Selector(text=\"<h1>Hello</h1>\")\nprint(document.css(\"h1::text\").get())\n",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Official description, parsel",
      "display": "Extracts data from HTML and XML with XPath and CSS selectors.",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Quickstart source file, parsel",
      "display": "usage.html",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "CSS selector queries, parsel",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "XPath queries, parsel",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Parsing/query model, parsel",
      "display": "HTML/XML selectors with CSS, XPath, and convenient scalar/list extraction; structured response extraction without browser execution.",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project function, parsel",
      "display": "@override\ndef find_links(self, parsed_content: Selector, selector: str, attribute: str) -> Iterable[str]:\n    link: Selector\n    urls: list[str] = []\n    for link in parsed_content.css(selector):\n        url = link.xpath(f'@{attribute}').get()\n        if url:\n            urls.append(url.strip())\n    return urls",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Project source file, parsel",
      "display": "src/crawlee/crawlers/_parsel/_parsel_parser.py",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project full_name, parsel",
      "display": "apify/crawlee-python",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project stargazers_count, parsel",
      "display": "9.7K",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Library name, scrapling",
      "display": "Scrapling",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Monthly downloads, scrapling",
      "display": "1.5M",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "License, scrapling",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Package release, scrapling",
      "display": "0.5.1",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Package release date, scrapling",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Install, scrapling",
      "display": "python3.13 -m pip install scrapling==0.5.1",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Quickstart, scrapling",
      "display": "from scrapling.parser import Selector\n\ndocument = Selector(\"<h1>Hello</h1>\")\nprint(document.css(\"h1::text\").get())\n",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Official description, scrapling",
      "display": "Scrapes the web through a high-performance Python framework.",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Quickstart source file, scrapling",
      "display": "parser.py",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "CSS selector queries, scrapling",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "XPath queries, scrapling",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Parsing/query model, scrapling",
      "display": "CSS/XPath extraction plus opt-in adaptive relocation and structural similarity; results depend on document structure rather than guaranteed stable identifiers.",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project function, scrapling",
      "display": "def select_items(url, selector, heal=False):\n    storage = {\"storage_file\": \"./fingerprints/elements_storage.db\", \"url\": url}\n    try:\n        Path(\"./fingerprints\").mkdir(exist_ok=True)\n        page = plain_get(url, selector_config={\"adaptive\": True, \"storage_args\": storage})\n        return page.css(selector, adaptive=heal, auto_save=True)\n    except (OSError, sqlite3.Error) as exc:\n        logger.warning(f\"자가치유 저장소 사용 불가, 일반 셀렉터로 계속: {exc}\")\n        page = plain_get(url, selector_config={\"adaptive\": False})\n        return page.css(selector)",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Project source file, scrapling",
      "display": "scripts/scrapling_reference.md",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Project full_name, scrapling",
      "display": "byungjunjang/web-crawler",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Project stargazers_count, scrapling",
      "display": "197",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Library name, pyquery",
      "display": "PyQuery",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Monthly downloads, pyquery",
      "display": "1.4M",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "License, pyquery",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Package release, pyquery",
      "display": "2.1.0",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Package release date, pyquery",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Install, pyquery",
      "display": "python3.13 -m pip install pyquery==2.1.0",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Quickstart, pyquery",
      "display": "from pyquery import PyQuery\n\ndocument = PyQuery(\"<h1>Hello</h1>\")\nprint(document(\"h1\").text())\n",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Official description, pyquery",
      "display": "Queries HTML in Python with a jQuery-like API.",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Quickstart source file, pyquery",
      "display": "pyquery.py",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "CSS selector queries, pyquery",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "XPath queries, pyquery",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Parsing/query model, pyquery",
      "display": "jQuery-style CSS selection and DOM changes over lxml elements; native lxml nodes remain accessible through indexing.",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Project function, pyquery",
      "display": "def redirect_url(self, source_locale=settings.LANGUAGE_CODE):\n    \"\"\"If I am a redirect, return the URL to which I redirect.\n\n    Otherwise, return None.\n\n    \"\"\"\n    # If a document starts with REDIRECT_HTML and contains any <a> tags\n    # with hrefs, return the href of the first one. This trick saves us\n    # from having to parse the HTML every time.\n    if self.is_redirect:\n        anchors = PyQuery(self.html)(\"a[href]\")\n        if anchors:\n            # Articles with a redirect have a link that has the locale\n            # hardcoded into it, and so by simply redirecting to the given\n            # link, we end up possibly losing the locale. So, instead,\n            # we strip out the locale and replace it with the original\n            # source locale only in the case where an article is going\n            # from one locale and redirecting it to a different one.\n            # This only applies when it's a non-default locale because we\n            # don't want to override the redirects that are forcibly\n            # changing to (or staying within) a specific locale.\n            full_url = anchors[0].get(\"href\")\n            (dest_locale, url) = split_into_language_and_path(full_url)\n            if source_locale != dest_locale and dest_locale == settings.LANGUAGE_CODE:\n                return f\"/{source_locale}{url}\"\n            return full_url",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Project source file, pyquery",
      "display": "kitsune/wiki/models.py",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Project full_name, pyquery",
      "display": "mozilla/kitsune",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Project stargazers_count, pyquery",
      "display": "1.7K",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Library name, requests-html",
      "display": "Requests-HTML",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Monthly downloads, requests-html",
      "display": "398.2K",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "License, requests-html",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Package release, requests-html",
      "display": "0.10.0",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Package release date, requests-html",
      "display": "Feb 2019",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Install, requests-html",
      "display": "python3.13 -m pip install requests-html==0.10.0 lxml-html-clean==0.4.6",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Quickstart, requests-html",
      "display": "from requests_html import HTML\n\ndocument = HTML(html=\"<h1>Hello</h1>\")\nprint(document.find(\"h1\", first=True).text)\n",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Official description, requests-html",
      "display": "Parses HTML with a human-friendly API.",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Quickstart source file, requests-html",
      "display": "requests_html.py",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "CSS selector queries, requests-html",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "XPath queries, requests-html",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Parsing/query model, requests-html",
      "display": "Requests session and parsed-response convenience with CSS/XPath; optional browser rendering is separate from local parsing. Modern lxml needs the separate cleaner dependency.",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Project function, requests-html",
      "display": "def main() -> bool:\n    html_session = HTMLSession()\n    response = html_session.get(PYPY_CHECKSUMS)\n    page = response.html\n    checksum_blocks = page.find(\"pre.literal-block\")\n    for csum_block in checksum_blocks:\n        python_version, pypy_version = parse_pypy_ver(csum_block.text)\n        py_it = f\"pypy{python_version}-{pypy_version}\"\n        if py_it not in EXCLUDED_RELEASES:\n            vbin_path = OUT_DIR.joinpath(py_it)\n            vsrc_path = OUT_DIR.joinpath(py_it+\"-src\")\n\n            kwargs = None\n            for ps in ((vbin_path, SCRIPT_BIN), (vsrc_path, SCRIPT_SRC)):\n                if not ps[0].is_file():\n                    kwargs = kwargs or parse_checksums_ext(csum_block.text)\n                    code = ps[1].format(\n                            version_pypy=pypy_version,\n                            version_python=python_version,\n                            ensurepip=\"ensurepip\" if not python_version == \"2.7\" else \"ensurepip_lt21\",\n                            **kwargs  # which are:\n                                      # checksum_aarch64\n                                      # checksum_linux32\n                                      # checksum_linux64\n                                      # checksum_osarm64\n                                      # checksum_osx64\n                                      # checksum_src\n                                      # file_ext\n                        )\n                    if not args.dry_run:\n                        with open(file=ps[0], mode=\"w\", encoding=\"utf-8\") as f:\n                            f.write(code)\n                            f.close()\n                    else:\n                        print(f\"---- DRY RUN SCRIPT FOR {ps[0]} ----\")\n                        print(code)",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Project source file, requests-html",
      "display": "plugins/python-build/scripts/add_pypy.py",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Project full_name, requests-html",
      "display": "pyenv/pyenv",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Project stargazers_count, requests-html",
      "display": "45.2K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python HTML parser libraries Beautiful Soup lxml selectolax html5lib code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
