0

全体計画

クラス情報を取得して、ユニクラスのタイムテーブルを自動的に最適化して選択します

全体的なアルゴリズム

  1. Enterprise SignOnEngineログインを使用してWebサイトにログオンします
  2. 私の現在の学期とそれに関連する科目を探す(事前設定)
  3. 右のページに移動して、関連する各主題からデータを取得します(講義、実習、ワークショップの時間)
  4. 役に立たない情報のデータを取り除く
  5. 互いに近いクラスを高くランク付けし、ランダムな日のクラスを低くランク付けします
  6. 最良のタイムテーブルソリューションを解決する
  7. BESTCASE情報の詳細リストを出力してください
  8. 可能なクラス情報の詳細なリストを出力してください(たとえば、完全なものもあります)
  9. プログラムを入手して、最適なクラスを自動的に選択します
  10. 7を達成できるかどうかを確認し続けます。

6詳細講義を中心にすべてのクラスを取得し、最高ランク(科目ごとに1つのみ)になり、その周りにクラスを配置してみてください。

質問

誰かが私に、うまくいけばPythonで書かれたこれに似ているかもしれない何かへのリンクを提供できますか?6.に関して:この情報を保存するためにどのデータ構造をお勧めしますか?ユニクラスの各オブジェクトのリンクリスト?すべての情報をテキストファイルに書き込む必要がありますか?

ユニクラスは次の属性のように設定されると思います。

  • 主題
  • ランク
  • 時間
  • タイプ
  • 先生

私はPythonの経験がほとんどなく、これは達成しようとする良い学習プロジェクトになると思いました。私を始めるのに役立つヘルプとリンクを提供してくれてありがとう、適切にタグ付けするための編集、または必要なものを開いてください(これがプログラミングとPython以外に該当するかどうかわかりませんか?)

編集:私がこのSO投稿に必要な適切なフォーマットを実際に取得することはできません> <

4

3 に答える 3

0

BeautifulSoup was mentioned here a few times, e.g get-list-of-xml-attribute-values-in-python.

Beautiful Soup is a Python HTML/XML parser designed for quick turnaround projects like screen-scraping. Three features make it powerful:

  1. Beautiful Soup won't choke if you give it bad markup. It yields a parse tree that makes approximately as much sense as your original document. This is usually good enough to collect the data you need and run away.
  2. Beautiful Soup provides a few simple methods and Pythonic idioms for navigating, searching, and modifying a parse tree: a toolkit for dissecting a document and extracting what you need. You don't have to create a custom parser for each application.
  3. Beautiful Soup automatically converts incoming documents to Unicode and outgoing documents to UTF-8. You don't have to think about encodings, unless the document doesn't specify an encoding and Beautiful Soup can't autodetect one. Then you just have to specify the original encoding.

Beautiful Soup parses anything you give it, and does the tree traversal stuff for you. You can tell it "Find all the links", or "Find all the links of class externalLink", or "Find all the links whose urls match "foo.com", or "Find the table heading that's got bold text, then give me that text."

Valuable data that was once locked up in poorly-designed websites is now within your reach. Projects that would have taken hours take only minutes with Beautiful Soup.

于 2009-01-07T09:39:56.103 に答える