Whoa, I'm not sure how I didn't catch that. Maybe I uploaded the wrong file or something. I'll fix that tonight.
I would compile my Go package ('bgmysword') for Mac for you, but there's a bug in the current version of Go with building programs for a different operating system. Once the next version of Go comes out, I'll be able to upload a Mac package.
EDIT
Fixed!
Also, I just had an idea. You could try this: bgmysword.zip It's for Linux but it MIGHT work for Mac.
Hi GR,
Tried the bgmysword.zip, could not get it to work for Mac. Looking forward to the Mac version once the next version of Go is released.
I tried your script (bible_gateway.py.zip for linux & mac) with partial success. I was trying to download the EXB (Expanded Bible). Got this error again.
Finding EXB copyright information...
Traceback (most recent call last):
File "/Users/****/Downloads/bible_gateway.py", line 558, in <module>
translation_name = Copyright(translation).search(base_url)
File "/Users/****/Downloads/bible_gateway.py", line 153, in search
self.copyright_info = soup.p.text
AttributeError: 'NoneType' object has no attribute 'text'
I think this is what the problem was, but I could be wrong as I've no knowledge of coding etc.
Your script has this on line 147
{'class': 'publisher-info-bottom'})
But the page for EXB on biblegateway has this
{'class': 'publisher-info-bottom with-bga'})
So I changed that in your script, and it worked great, it started the download....until around book 22, when I got the following errors.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 518, in urlopen
body=body, headers=headers)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 322, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 727, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 204, in connect
conn = self._new_conn()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 134, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 64, in create_connection
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socket.py", line 530, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/adapters.py", line 370, in send
timeout=timeout
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 564, in urlopen
_pool=self, _stacktrace=stacktrace)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py", line 245, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py", line 309, in reraise
raise value.with_traceback(tb)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 518, in urlopen
body=body, headers=headers)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 322, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 727, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 204, in connect
conn = self._new_conn()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 134, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 64, in create_connection
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socket.py", line 530, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/****/Downloads/bible_gateway.py", line 600, in <module>
SwordMe(num_book_chap, base_url)
File "/Users/****/Downloads/bible_gateway.py", line 236, in __init__
self.iter_me_chap(num, book, chap, base_url)
File "/Users/****/Downloads/bible_gateway.py", line 252, in iter_me_chap
sql_tuple = self.parse_me(book_num, curr_chap_num, url)
File "/Users/****/Downloads/bible_gateway.py", line 269, in parse_me
soup, soup_footnotes = self.fetch_me(url)
File "/Users/****/Downloads/bible_gateway.py", line 259, in fetch_me
content = requests.get(url, verify=True, timeout=20)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/api.py", line 65, in get
return request('get', url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/api.py", line 49, in request
response = session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/sessions.py", line 461, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))
I have no idea what they mean, and I'm sorry to keep troubling you, maybe it's Mac related. If this can be easily solved, that would be great, but if it's too much trouble, that's fine too, I'll just wait for your bgmysword for mac.
Thanks