Jump to content

dyan's Content

There have been 5 items by dyan (Search limited from 20-April 23)


Sort by                Order  

#23935 BibleGateway to MySword

Posted by dyan on 05 February 2015 - 05:28 AM in MySword

Hey GR,

 

Thanks for the excellent instructions. I managed to use both the script as well as bgmysword on the Mac. Both worked very well.

 

Finally got the EXB into mysword format. The only problem is that there are a total of 47660 verses, instead of the standard 31102 verses.

The script is somehow breaking up the verses at the wrong point. I've opened the file in SQLite Manager and compared it with a KJV bible and found this to be true.

 

Please help!

 

Thanks




#23886 BibleGateway to MySword

Posted by dyan on 31 January 2015 - 01:47 PM in MySword

 
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: attachicon.gifbgmysword.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



#23800 BibleGateway to MySword

Posted by dyan on 22 January 2015 - 10:15 AM in MySword

Hi GR,

 

I've tried the new code. Still unable to download. I'm on a Mac OS X Yosemite.

 

For the Expanded Bible (EXB), I get the following error:

Traceback (most recent call last):
  File "/Users/***/Downloads/bible_gateway1.py", line 569, in <module>
    translation_name = Copyright(translation).search(base_url)
  File "/Users/***/Downloads/bible_gateway1.py", line 156, in search
    self.publisher_info = soup.p.a.text
AttributeError: 'NoneType' object has no attribute 'a'

And for other bible, such as KJV, ESV

Traceback (most recent call last):
  File "/Users/***/Downloads/bible_gateway1.py", line 569, in <module>
    translation_name = Copyright(translation).search(base_url)
  File "/Users/***/Downloads/bible_gateway1.py", line 158, in search
    self.accept_me()
  File "/Users/***/Downloads/bible_gateway1.py", line 179, in accept_me
    ''.join((self.copyright_info_bak.strip())),
TypeError: sequence item 0: expected str instance, int found



#23783 BibleGateway to MySword

Posted by dyan on 21 January 2015 - 04:53 AM in MySword

Hm that's odd. That means that it couldn't find the spot on the webpage that shows the copyright information. Which translation were you trying to download? I can't seem to find one that gives me that error.

 

The version I was trying to download was the expanded bible.




#23705 BibleGateway to MySword

Posted by dyan on 14 January 2015 - 12:08 PM in MySword

Hi,

 

I'm trying to download a bible to convert to mysword bible. I keep getting this error while running the script:

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'

What should I do?