Jump to content

GreenRaccoon23

Member Since 05 Aug 2014
Offline Last Active Feb 24 2015 01:19 PM
*****

Posts I've Made

In Topic: BibleGateway to MySword

01 February 2015 - 07:10 PM

 

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.

...

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.

...
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

 

Hey nice job figuring that out!

 

If I were you, I'd try running the 'bible_gateway.py' script again. It just means that it couldn't load the webpage. That happens to me sometimes too. (When it's loading a million webpages, it's not unlikely that one of them will mess up.) I added a workaround for this in the 'bgmysword' program, but unfortunately there's not a way to do it for the 'bible_gateway.py' script.

 

I'll keep looking to see if I can get it set up for Mac. It might be pretty easy to make instructions to install it from my github page.

 

 EDIT

It looks like it'd be pretty easy for you to make a Mac version of the 'bgmysword' program yourself. This would involve you downloading the code for it, installing a program called 'gcc', installing Google's 'Go' program, and then running a couple commands in Terminal. It sounds like a lot, but it should be easy. (For Windows it's a nightmare though. :wacko:) I'll show you how to do it.

  1. Follow steps 1 and 2 from here to install 'gcc': http://www.cyberciti...l-gcc-compiler/
  2. Download 'Go 1.4.1' from here: https://golang.org/dl/. The Mac versions start with 'darwin'. 'amd64' means 64-bit and '386' means 32-bit.
  3. Install it. In case you get stuck, this page might help: http://www.cyberciti...ge-on-mac-os-x/
  4. Then run these two commands in Terminal:
    go get github.com/GreenRaccoon23/bgmysword
    go install github.com/GreenRaccoon23/bgmysword
    
  5. Then run it in Terminal like this:
    bgmysword

In Topic: BibleGateway to MySword

01 February 2015 - 06:44 PM

I figured out that the bug appears in every chapter of every book that is part of a series of books (e.g. 1 Samuel, 2 Samuel, 1 Timothy, 2 Timothy, 1 Thessalonians, 2 Thessalonians, etc.). Apparently the additional number in the title of the book is the culprit and is confusing the programming algorithm. That's my guess.

Thanks for your hard work.

Ok, sorry about the delay. It was a pretty easy fix but it helped me find a bunch of other bugs. I've finished ironing everything out and I'll upload the new version.


In Topic: BibleGateway to MySword

25 January 2015 - 05:59 PM

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

 
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: Attached File  bgmysword.zip   2.86MB   14 downloads It's for Linux but it MIGHT work for Mac. 


In Topic: BibleGateway to MySword

25 January 2015 - 05:43 PM

I figured out that the bug appears in every chapter of every book that is part of a series of books (e.g. 1 Samuel, 2 Samuel, 1 Timothy, 2 Timothy, 1 Thessalonians, 2 Thessalonians, etc.). Apparently the additional number in the title of the book is the culprit and is confusing the programming algorithm. That's my guess.

Thanks for your hard work.

Ok thanks I'll look into it tonight. I'm sure it's just a little, dumb mistake I made.


In Topic: BibleGateway to MySword

19 January 2015 - 06:38 PM

Thanks GR ...

 

I tried that, but it still doesn't seem to be finding lxml.

 

Traceback (most recent call last):
  File "bible_gateway.py", line 558, in <module>
    translation_name = Copyright(translation).search(base_url)
  File "bible_gateway.py", line 152, in search
    parse_only=only_publisher_tag)
  File "C:\Python34\lib\site-packages\bs4\__init__.py", line 152, in __init__
    % ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requeste
d: lxml. Do you need to install a parser library?

 

Googling this ... it looks to be an issue with BeautifulSoup? I have version 4.3.2 which appears to be current.  Should I downgrade?

 

Ok ... I went down to Python 3.2 and was able to install lxml.

I found out that you can't install lxml with Python 3.4.2 because with the latest version of lxml, someone either forgot to upload or just didn't upload a 64-bit version. In case you want to install Python 3.4.2, I wrote a script that will download and install a 64-bit version of lxml.