質問編集履歴

1

コードの追加

2018/10/18 03:45

投稿

konichan527
konichan527

スコア11

test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,47 @@
17
17
  Pythonについて全くの初心者です。
18
18
 
19
19
  よろしくお願い致します。
20
+
21
+
22
+
23
+
24
+
25
+ 追記:
26
+
27
+ BeautifulSoup4というライブラリを使ってhtmlを抽出しています。
28
+
29
+ 以下にコードを示しておきます。
30
+
31
+ urlは自分の大学のものなので伏せています。
32
+
33
+ ```python3
34
+
35
+ import requests,ui,bs4
36
+
37
+
38
+
39
+ res = requests.get("https://www.****.ac.jp")
40
+
41
+ res.raise_for_status()
42
+
43
+ soup = bs4.BeautifulSoup(res.text,"html.parser")
44
+
45
+ elems = soup.select('td')
46
+
47
+
48
+
49
+ def time(sender):
50
+
51
+ label = sender.superview['label1']
52
+
53
+ for elem in elems:
54
+
55
+ label.text += elem.getText() + '\n'
56
+
57
+
58
+
59
+ v = ui.load_view()
60
+
61
+ v.present('fullscreen')
62
+
63
+ ```