Jump to content


Photo

Problems With Beans-r-us Site


  • Please log in to reply
31 replies to this topic

#1 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 30 June 2010 - 11:17 PM

A number of readers have reported problems accessing the beans-r-us.biz site (which redirects from GoDaddy to a server at the Institute of Technology, Carlow in Ireland called beans.itcarlow.ie). This server is generally available most of the time, however, it sometimes goes down for maintenance (and the scheduling of this is beyond my control). As a backup, I have created a Google App Engine-powered Beans-R-Us service here: http://beans-r-us.ap...com/prices.html. This site provides exactly the same content as the beans-r-us.biz site.

When working through the chapter, try the sites in this order:

First: always try http://www.beans-r-us.biz as shown in the book.
If this causes an error, try http://beans.itcarlow.ie directly.
If you still get an error, try the backup: http://beans-r-us.ap...com/prices.html

If your error still persists: CHECK YOUR CODE. :-)

Have fun.

Paul.

#2 AmeliaB28

AmeliaB28

    New Member

  • Members
  • Pip
  • 2 posts

Posted 10 July 2010 - 09:22 PM

Thanks!

#3 antiher0sk8s

antiher0sk8s

    New Member

  • Members
  • Pip
  • 2 posts

Posted 06 November 2010 - 05:44 PM

I have limited access to the internet durring the day. however i have saved both beans r us websites to a directory in hopes that i could some how use these pages offline. i need the ability to call the text from the .html file that i have saved, however due to my inexperience i do not know the code or lib function to get the text from the file to continue this lesson.

#4 antiher0sk8s

antiher0sk8s

    New Member

  • Members
  • Pip
  • 2 posts

Posted 06 November 2010 - 07:24 PM

going to answer my own question here. after additional research for lack of patience on my part. so in the event that anyone needs to do this offline becuase of limited internet access. dl the web page to any directory you see fit.

set the file to a variable example below

page = open('/absolute/file/direcotry/beans-r-us-offline.html')
text = page.read()

then continue with the lesson plan


#5 dok53

dok53

    New Member

  • Members
  • Pip
  • 6 posts

Posted 20 March 2011 - 08:08 PM

i just got your book on programming and im having a BIG problem with the beans r us part ive tried all your online solutions but cant fix it and i cant move any further as i need to do this to understand all the other stuff in your book can u please help me

#6 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 20 March 2011 - 11:06 PM

Hi dok53.

Can you please detail what the problem is so that everyone on the forum can offer solutions to you? Thanks.

--Paul.

#7 dok53

dok53

    New Member

  • Members
  • Pip
  • 6 posts

Posted 21 March 2011 - 11:52 AM

Hi Paul

Sorry the problem im having is that no matter what http:// i enter i keep getting the same error message,,import error: no module named request

#8 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 21 March 2011 - 12:00 PM

At your command-prompt (command window/terminal) type:

python -V

on Linux/Mac OS X or:

python.exe -V

on Windows. Make sure you are running Python 3. If you're on 2, you'll need to upgrade. If you are on 3, please paste in your code so that we can see it.

Thanks.

--Paul.

#9 dok53

dok53

    New Member

  • Members
  • Pip
  • 6 posts

Posted 21 March 2011 - 02:54 PM

Hi Paul

I upgraded to python 3 and entered the code again from the book and the "appspot" alternative but still wont work.here's the code i typed;
import urllib.request
page=urllib.request.urlopen("http://www.beans-r-u...iz/prices.html")
text=page.read().decoder("utf8")
print (text)

it changed colour to the same as shown in the book but i got a new error saying
attribute error:'bytes' object has no attribute 'decoder'

Thanks
dok

#10 dok53

dok53

    New Member

  • Members
  • Pip
  • 6 posts

Posted 21 March 2011 - 03:13 PM

Hi Paul

I got it thank you it had something to do with the way i had saved it

Cheers
Dok

#11 clearsmith

clearsmith

    New Member

  • Members
  • Pip
  • 2 posts

Posted 22 August 2011 - 12:22 AM

thank you!
theadidas soccer shoeswhich my mom bought for my birth gift is my best treasure!!

#12 Rascal17

Rascal17

    New Member

  • Members
  • Pip
  • 3 posts

Posted 23 September 2013 - 09:06 AM

Help PLEASE!

I downloaded Python 3.3 to learn Python with my book, "Head First Programming".

I copied the code exactly from the book and got a huge, long error which I have pasted below. I got to this site and thread and tried each of the different website links above for the beans site and none worked. Here is my code and the error message follows. Can someone please help as I can not go further until this is resolved - thanks! FYI - I tried this code with and without spaces in and around "page", "text", and "print" with no luck,

MY CODE:

import urllib.request
page=urllib.request.urlopen("http://beans-r-us.ap...om/prices.html")
text=page.read().decode("utf8")
print (text)


ERROR MESSAGE:
Traceback (most recent call last):
File "C:\Python33\lib\urllib\request.py", line 1248, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "C:\Python33\lib\http\client.py", line 1061, in request
self._send_request(method, url, body, headers)
File "C:\Python33\lib\http\client.py", line 1099, in _send_request
self.endheaders(body)
File "C:\Python33\lib\http\client.py", line 1057, in endheaders
self._send_output(message_body)
File "C:\Python33\lib\http\client.py", line 902, in _send_output
self.send(msg)
File "C:\Python33\lib\http\client.py", line 840, in send
self.connect()
File "C:\Python33\lib\http\client.py", line 818, in connect
self.timeout, self.source_address)
File "C:\Python33\lib\socket.py", line 417, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Python33/StarBuzz.py", line 3, in <module>
page=urllib.request.urlopen("http://beans-r-us.ap...om/prices.html")
File "C:\Python33\lib\urllib\request.py", line 156, in urlopen
return opener.open(url, data, timeout)
File "C:\Python33\lib\urllib\request.py", line 469, in open
response = self._open(req, data)
File "C:\Python33\lib\urllib\request.py", line 487, in _open
'_open', req)
File "C:\Python33\lib\urllib\request.py", line 447, in _call_chain
result = func(*args)
File "C:\Python33\lib\urllib\request.py", line 1268, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "C:\Python33\lib\urllib\request.py", line 1251, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
>>>

#13 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 23 September 2013 - 10:54 AM

Your code is fine, and it works. I've just executed it on Python 3.3 on my computer, and it worked fine. One thing to check may be if you are operating behind some sort of firewall (either on your computer or at your site). If a firewall (or proxy) is "blocking" you, the code will not work.

But - to confirm - the code is fine. It works.

--Paul.

#14 Rascal17

Rascal17

    New Member

  • Members
  • Pip
  • 3 posts

Posted 23 September 2013 - 11:11 AM

Thanks for getting back with me on this. I am at home and went ahead and shut down my complete virus protection altogether. Still no luck as the same error occurs!

Perhaps it is how I saved it? I saved it as StarBuzz.py.

This is very puzzling! Does the error code above give any clue(s) at all?

Edited by Rascal17, 23 September 2013 - 11:12 AM.


#15 Rascal17

Rascal17

    New Member

  • Members
  • Pip
  • 3 posts

Posted 23 September 2013 - 11:42 AM

Mr Barry - After being overly careful about the code syntax . . . this ended up being an internet issue! My laptop had problems connecting but did not report these issues back to me!

All is well - thanks for your help!

Al

#16 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 24 September 2013 - 12:25 AM

I was just about to suggest checking your Internet connections... I'm glad you are back on-line and on-track. :-)

--Paul.

#17 Prash.vij

Prash.vij

    New Member

  • Members
  • Pip
  • 1 posts

Posted 29 October 2013 - 04:53 AM

In Chapter 2, in the program where the float() method is introduced , I am getting an error. Can you please help me with that. I am using python 3.4.0a4
This is the program:

import urllib.request

price = 99.99
while price > 4.74:
page = urllib.request.urlopen("http://www.beans-r-u...iz/prices.html")
text = page.read().decode("utf8")
where = text.find('>$')
start_of_price = where + 2
end_of_price = start_of_price + 4
price = float(text[start_of_price:end_of_price])
print("Buy!")

and this is the error i get:

Traceback (most recent call last):
File "F:/Python/python 8.py", line 11, in <module>
price = float(text[start_of_price:end_of_price])
ValueError: could not convert string to float: '!DOC'

Edited by Prash.vij, 29 October 2013 - 04:56 AM.


#18 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 01 November 2013 - 01:57 PM

Please see this post: http://forums.oreill...-beans-r-usbiz/

Thanks.

--Paul.

#19 JALT_32357

JALT_32357

    New Member

  • Members
  • Pip
  • 1 posts

Posted 15 November 2013 - 02:05 AM

n/a

Edited by JALT_32357, 15 November 2013 - 02:42 AM.


#20 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 17 November 2013 - 03:27 AM


By google searching "beans r us", i found out only below few links which are working properly.

1. beans r us first link

2. beans r us second link

3. beans r us third link

Try clicking the above three links or better try google search for the keywords "beans r us", you will find the three above sites.


B) :)

Edited by #TM#, 17 November 2013 - 03:27 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users