웹 페이지 또는 HTML을 캡처하거나 변환하는 방법에 대한 질문 into 이미지, CSV, PDF 또는 DOCX 문서 및 비디오 변환 방법 into 애니메이션 GIF는 API를 사용합니다.
오류:
추적 (최근 호출 마지막) :
File "GrabzItClient.py", line 6, in <module>
그랩즈잇.SaveTo("documents/result.docx")
File "C:\Program Files\Python36\lib\site-packages\GrabzIt\GrabzItClient.py", line 235, in SaveTo
id = self.Save()
File "C:\Program Files\Python36\lib\site-packages\GrabzIt\GrabzItClient.py", line 209, in Save
obj = self._take(sig, callBackURL)
File "C:\Program Files\Python36\lib\site-packages\GrabzIt\GrabzItClient.py", line 223, in _take
return self.HTTPPost(self.request.url, self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'html', quote(self.request.data)))
File "C:\Program Files\Python36\lib\site-packages\GrabzIt\GrabzItClient.py", line 629, in HTTPPost
h.endheaders()
File "C:\Program Files\Python36\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Program Files\Python36\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "C:\Program Files\Python36\lib\http\client.py", line 964, in send
self.connect()
File "C:\Program Files\Python36\lib\http\client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "C:\Program Files\Python36\lib\socket.py", line 704, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Program Files\Python36\lib\socket.py", line 743, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
source:(I installed GrabzIt and got APPLICATION KEY and APPLICATION SECRET)
GrabzIt에서 GrabzItClient 가져오기
grabzIt = GrabzItClient.GrabzItClient(APPLICATION KEY, APPLICATION SECRET)
그랩즈잇.HTMLToDOCX("<html><body><h1>Hello World!</h1></body></html>")
그랩즈잇.SaveTo("documents/result.docx")
could you tell me what should I do ?
커뮤니티에 오신 것을 환영합니다!
보통 socket.gaierror: [Errno 11001] getaddrinfo failed is caused when the code is being called from behind a firewall or proxy. Please ensure the application has access to port 80.
응답 해주셔서 감사합니다.
Yes,It's the problem of proxy.It runs OK when I change the other PC which have not proxy.
How can it work with proxy?
This will be a new feature. We are looking if we can alter the Python client to enable using proxy servers.
If it is possible we will get back to you with a fix. You can have a go yourself if you like as all of our clients are open source: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py
We have added the new feature. Just download the GrabzItClient.py file and replace your copy from here: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py
You can then set the proxy url of your proxy server lusing the new SetLocalProxy method, for example:
grabzIt.SetLocalProxy("http://123.123.123.123:21231")
Please let us now how it goes and we will do a new release soon!
응답 해주셔서 감사합니다.
나는 바꿨다 the GrabzItClient.py and changed my source :
grabzIt = GrabzItClient.GrabzItClient(APPLICATION KEY, APPLICATION SECRET)
grabzIt.SetLocalProxy("http://xxx@jp.xxxxx.com:yyyyyyy@zzz.proxy.zzz.zzzzzzz.com:8080")
그랩즈잇.HTMLToDOCX("<html><body><h1>Hello World!</h1></body></html>")
그랩즈잇.SaveTo("documents/result.docx")
사용자:xxx@jp.xxxxx.com
비밀번호 :yyyyyyy
proxy server:zzz.proxy.zzz.zzzzzzz.com
포트:8080
error message:
추적 (최근 호출 마지막) :
File "GrabzIt_test.py", line 54, in <module>
그랩즈잇.SaveTo("result.docx")
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 487, in SaveTo
id = self.Save()
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 435, in Save
obj = self._take(sig, callBackURL)
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 463, in _take
return self.HTTPPost(self.request.url, self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'html', quote(self.request.data)))
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 1307, in HTTPPost
headers['Proxy-Authorization'] = 'Basic ' + base64.b64encode(auth)
File "C:\Program Files\Python36\lib\base64.py", line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'
same error message even I changed SetLocalProxy 에서 "http://xxx@jp.xxxxx.com:yyyyyyy@zzz.proxy.zzz.zzzzzzz.com:8080"~에 "http://xxx%40jp.xxxxx.com:yyyyyyy@zzz.proxy.zzz.zzzzzzz.com:8080"
sorry,may be I set the wrong proxy.
I changed the proxy to "http://the_other_proxy_server:port" and error message became:
추적 (최근 호출 마지막) :
File "GrabzIt_test.py", line 54, in <module>
그랩즈잇.SaveTo("result.docx")
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 487, in SaveTo
id = self.Save()
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 435, in Save
obj = self._take(sig, callBackURL)
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 463, in _take
return self.HTTPPost(self.request.url, self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'html', quote(self.request.data)))
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 1327, in HTTPPost
h.endheaders()
File "C:\Program Files\Python36\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Program Files\Python36\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "C:\Program Files\Python36\lib\http\client.py", line 964, in send
self.connect()
File "C:\Program Files\Python36\lib\http\client.py", line 940, in connect
self._tunnel()
File "C:\Program Files\Python36\lib\http\client.py", line 919, in _tunnel
message.strip()))
OSError: Tunnel connection failed: 407 Proxy Authentication Required
You need to specify your username and password like so: http://username:password@example.com:12335
Yes,I specified my username and password (question on Wednesday, 22 August, 2018 09:34:43 AM) like :
http://username:password@example.com:12335
username is Email address (xxx@jp.xxxxx.com) so I changed to xxx%40jp.xxxxx.com
but it's the same error message:TypeError: a bytes-like object is required, not 'str'
Sorry, I missed your previous response. I think this is a Python 3 issue and have released a fix that should solve the error. Please can you update GrabzItClient.py again from: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py
I replaced python file and find new error message:
추적 (최근 호출 마지막) :
File "GrabzIt_test.py", line 54, in <module>
그랩즈잇.SaveTo("result.docx")
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 244, in SaveTo
id = self.Save()
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 218, in Save
obj = self._take(sig, callBackURL)
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 232, in _take
return self.HTTPPost(self.request.url, self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'html', quote(self.request.data)))
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 661, in HTTPPost
headers['Proxy-Authorization'] = 'Basic ' + encodedAuth
TypeError: must be str, not bytes
Ok, we have decoded it into ascii. We aren't using Python 3, which is why it caught us out. Please update your code from here: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py
As this is open source, feel free to debug and commit any improvements you want to Github. As we don't have access to your setup.
당신의 도움에 많은 감사드립니다.
OSError: Tunnel connection failed: 407 Proxy Authentication Required
I will try to debug.
We think we know what the issue is, however it will require re-writing some of the code. So we will contact you when done. Hopefuly in 24 hours.
I believe we have fixed the issue! You can get the latest versiom here: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py
답변 감사합니다.
New error message:
추적 (최근 호출 마지막) :
File "GrabzIt_test.py", line 54, in <module>
그랩즈잇.SaveTo("result.docx")
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 243, in SaveTo
id = self.Save()
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 217, in Save
obj = self._take(sig, callBackURL)
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 231, in _take
return self.HTTPPost(self.request.url, self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'html', quote(self.request.data)))
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 629, in HTTPPost
h = self._getConnection()
File "C:\TEST\GrabzIt_python\GrabzIt\GrabzItClient.py", line 679, in _getConnection
h.putheader('proxy-authorization', 'Basic ' + encodedAuth)
File "C:\Program Files\Python36\lib\http\client.py", line 1201, in putheader
raise CannotSendHeader()
http.client.CannotSendHeader
We have made some minor improvements to: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py
And have tested it in Python 2.7, 3.4 and 3.6 and it works in all enviroments, with and without proxies and with authorized proxies.
If it is still not working for you, you will need to debug the code.
답장을 보내 주셔서 감사합니다.
I will debug my source.
By the way, did you tested the username which is Email like xxx@yyy.com ?