質問編集履歴

3

コードの見た目の習性

2018/06/17 16:12

投稿

etherwind
etherwind

スコア28

test CHANGED
File without changes
test CHANGED
@@ -17,6 +17,8 @@
17
17
  現在のコード(sample.py)
18
18
 
19
19
  ──────────
20
+
21
+ ```ここに言語を入力
20
22
 
21
23
  import requests, bs4
22
24
 
@@ -43,6 +45,8 @@
43
45
  writer = csv.writer(f)
44
46
 
45
47
  writer.writerows(elems)
48
+
49
+ ```
46
50
 
47
51
  ──────────
48
52
 

2

コードの修正

2018/06/17 16:12

投稿

etherwind
etherwind

スコア28

test CHANGED
File without changes
test CHANGED
@@ -34,15 +34,15 @@
34
34
 
35
35
  for elem in elems:
36
36
 
37
- print(elem)
37
+ print(elem)
38
38
 
39
39
 
40
40
 
41
41
  with open('news.csv', 'w', encoding='CP932', errors='ignore') as f:
42
42
 
43
- writer = csv.writer(f)
43
+ writer = csv.writer(f)
44
44
 
45
- writer.writerows(elems)
45
+ writer.writerows(elems)
46
46
 
47
47
  ──────────
48
48
 

1

2018/06/17 16:03

投稿

etherwind
etherwind

スコア28

test CHANGED
File without changes
test CHANGED
@@ -23,8 +23,6 @@
23
23
  import csv
24
24
 
25
25
 
26
-
27
- import requests, bs4
28
26
 
29
27
  res = requests.get('https://news.yahoo.co.jp/pickup/6286588')
30
28