Giter Site home page Giter Site logo

Comments (4)

ftnext avatar ftnext commented on August 22, 2024

スクレイピング

https://www.crummy.com/software/BeautifulSoup/bs4/doc/#find-all

soup.find_all("p", "title")
  • 第1引数 name:HTMLタグの名前(pタグ)
  • 第2引数 attrs:クラス(titleクラス) ←これを指定できる

かつて書いたスクリプトはnameを指定して解決していた
https://github.com/ftnext/anime-fan-python/blob/fa83b36592b8a55d74889ca7ab12d45daa5f6e53/zero-wa-giri/anime_list.py

spanの除き方がぱっと分からなかったので、ルールベースでspanの部分の文字列を除去した
(除きたい文字列が固定だったので、removeprefixで除いた)
https://www.python.org/dev/peps/pep-0616/

from 2021_slides.

ftnext avatar ftnext commented on August 22, 2024

Reveal.jsスライドでグラフにして表示

GitPitchでChart.jsが使えていたことを思い出し、Reveal.jsでも使えるだろうと手を動かしてみた(きれいなグラフ表示をしたかった)
https://github.com/geekygirlsarah/gitpitch-cheat-sheet/blob/master/README.md#charts

Chart.jsはv3(ヒットする日本語翻訳はv2なのでプロパティ名など変わっていることに注意)

棒グラフで出したかったので、https://www.chartjs.org/docs/latest/getting-started/usage.html の例を使用
https://www.chartjs.org/docs/next/charts/bar.html (積ん読。細かい設定用)

HTMLのスライドではCDNから入手
https://cdnjs.com/libraries/Chart.js
ref: https://www.chartjs.org/docs/latest/getting-started/installation.html#cdn

スライド全面に出てしまう事象には、options.responsiveをfalseに指定
https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options

色の指定(全7色用意されている)
https://www.chartjs.org/docs/latest/samples/utils.html

Reveal.jsのスタイルは黒背景なので、文字の色を変えた

from 2021_slides.

ftnext avatar ftnext commented on August 22, 2024

Future works

from 2021_slides.

ftnext avatar ftnext commented on August 22, 2024

fb99868 Chart.jsで動作したのでclose

from 2021_slides.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.