PyScript

gihyo.jp

<html>

  <head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
    <script defer src="https://pyscript.net/latest/pyscript.js"></script>
  </head>

  <body>
    <py-config>
      packages = ["requests", "pyodide-http", "beautifulsoup4", "lxml"]
    </py-config>
    <py-script>
      import requests
      import pyodide_http
      from bs4 import BeautifulSoup

      pyodide_http.patch_all() 
      r = requests.get("https://www.city.imabari.ehime.jp/suidou/sp/suigen/dam.html")

      soup = BeautifulSoup(r.content, "lxml")

      display(soup.prettify())
    </py-sctip>
  </body>

</html>