質問編集履歴

2

誤字

2018/01/22 13:57

投稿

CpinOh
CpinOh

スコア12

test CHANGED
File without changes
test CHANGED
@@ -110,7 +110,7 @@
110
110
 
111
111
 
112
112
 
113
- サンプルソースでは、close()ような指示がけれど、
113
+ サンプルソースでは、close()ような指示が書いていないけれど、
114
114
 
115
115
  close(),exit()ような処理が必要ですか。
116
116
 

1

文法の修正

2018/01/22 13:57

投稿

CpinOh
CpinOh

スコア12

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,7 @@
1
+ #1質問内容を修正しました
2
+
3
+
4
+
1
5
  まだまだ独学中のメガネです。
2
6
 
3
7
  https://qiita.com/code_monkey/items/0d38a92a2a2026f5ec82
@@ -34,10 +38,82 @@
34
38
 
35
39
  上記のサイトを参考して、urlは表示できました、そのあとに
36
40
 
41
+ Traceback (most recent call last):
42
+
43
+ File "C:\Users\Ohcpin-Private\Desktop\Google.py", line 14, in <module>
44
+
45
+ main()
46
+
47
+ File "C:\Users\Ohcpin-Private\Desktop\Google.py", line 11, in main
48
+
49
+ google_search("神威 意味")
50
+
51
+ File "C:\Users\Ohcpin-Private\Desktop\Google.py", line 6, in google_search
52
+
53
+ for url in search(query,lang= 'jp',num=limit):
54
+
55
+ File "C:\Program Files (x86)\Python37-32\lib\site-packages\googlesearch\__init__.py", line 359, in search
56
+
57
+ html = get_page(url)
58
+
59
+ File "C:\Program Files (x86)\Python37-32\lib\site-packages\googlesearch\__init__.py", line 147, in get_page
60
+
61
+ response = urlopen(request)
62
+
63
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 222, in urlopen
64
+
65
+ return opener.open(url, data, timeout)
66
+
67
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 531, in open
68
+
69
+ response = meth(req, response)
70
+
71
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 641, in http_response
72
+
73
+ 'http', request, response, code, msg, hdrs)
74
+
75
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 563, in error
76
+
77
+ result = self._call_chain(*args)
78
+
79
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 503, in _call_chain
80
+
81
+ result = func(*args)
82
+
83
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 755, in http_error_302
84
+
85
+ return self.parent.open(new, timeout=req.timeout)
86
+
87
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 531, in open
88
+
89
+ response = meth(req, response)
90
+
91
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 641, in http_response
92
+
93
+ 'http', request, response, code, msg, hdrs)
94
+
95
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 569, in error
96
+
97
+ return self._call_chain(*args)
98
+
99
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 503, in _call_chain
100
+
101
+ result = func(*args)
102
+
103
+ File "C:\Program Files (x86)\Python37-32\lib\urllib\request.py", line 649, in http_error_default
104
+
105
+ raise HTTPError(req.full_url, code, msg, hdrs, fp)
106
+
37
- ...urllib2.HTTPError: HTTP Error 503: Service Unavailableのエラーがずっと出てきています。
107
+ urllib.error.HTTPError: HTTP Error 503: Service Unavailabl
108
+
109
+ のエラーが出てきていました。
38
110
 
39
111
 
40
112
 
41
- 解決方法を教えてくますか?
113
+ サンプルソースでは、close()ような指示がけど、
42
114
 
43
- close(),exit()のどの処理がまだ足りていないしょう
115
+ close(),exit()ような処理が必要
116
+
117
+
118
+
119
+ ブラウザで検索なら、問題がないけれど、この.pyだけ実行すると、この問題が発生しました。