How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console oridle versions.

S

Simon Evans

Hi Ian, thank you for your help.
Yes that is the book by Vineeth J Nair.
At the top of page 12, at step 1 it says :

1.Download the latest tarball from https://pypi.python.org/packages/source/b/beautifulsoup4/.

So yes, the version the book is dealing with is beautiful soup 4.
I am using Pyhon 2.7, I have removed Python 3.4.
Also on the bottom of page 10, Mr Nair states:

Pick the path variagble and add the following section to the Path variable:

;C:\PythonXY for example C:\Python27

Which tells me that the Python version cited in the book must be 2.7

I downloaded beautiful soup 4 last night. I unzipped it with 'Just unzip it' to a folder I called Beautiful Soup, the same as I did with the previous beautiful soup download. The console return is as below, showing that I am now facing the same conundrum as yesterday, before changing my version of Beautiful Soup. re:
--------------------------------------------------------------------------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>Beautiful Soup>c:\Python27\python setup.py install
'Beautiful' is not recognized as an internal or external command,
operable program or batch file.

c:\Beautiful Soup>
 
S

Simon Evans

The version of Python the book seems to be referring to is 2.7, re: bottom of page 10-
'Pick the Path variable and add the following section to the Path variable:;C:\PythonXY for example C:\Python 27'

The version of Beautiful Soup seems to be Beautiful Soup 4 as at the top ofpage 12 it states:
'1.Download the latest tarball from https://pypi.python.org/packages/source/b/beautifulsoup4/.'

I have downloaded and unzipped to a folder called 'Beautiful Soup' on the Cdrive the Beautiful Soup 4 version. I am using the Python 2.7 console and IDLE, I have removed the 3.4 version.

All the same I seem to be having difficulties again as console wont accept the code it did when it was the previous version of BS that I used yesterday. I realise I would not be having this problem if I proceeded to input the'Hello World' code on the Python console, but as said, the text never specifically said 'change to Python 2.7 console'. I thought the problem was with the BS version and so changed it, but now can't even get as far as I had before changing it. Anyhow be that as it may, this is the console response to my input:
--------------------------------------------------------------------------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>Beautiful Soup>c:\Python27\python setup.py install
'Beautiful' is not recognized as an internal or external command,
operable program or batch file.

c:\Beautiful Soup>
 
S

Simon Evans

Thank you for your advice. I did buy a book on Python, 'Hello Python' but the code in it wouldn't run, so I returned it to the shop for a refund. I amgoing to visit the local library to see if they have any books on Python. I am familiar with Java and Pascal, and looking at a few You tubes on the subject, thought it was not much different, and shares many of the oop concepts (variables, initializing, expressions, methods, and so on, but I realize there is no point in walking backwards in new territory.
 
S

Simon Evans

Dear Ian,
The book does recommend to use Python 2.7 (see bottom line of page 10).
The book also recommends to use Beautiful Soup 4.
You are right that in that I have placed the unzipped BS4 folder within a folder, and I therefore removed the contents of the inner folder and transferred them to the outer folder.
The console now can access the contents of the Beautiful Soup folder, but it is still having problems with it as the last output to my console demonstrates :


Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install
running install
running build
running build_py
error: package directory 'bs4' does not exist

c:\Beautiful Soup>
 
S

Simon Evans

I did download the latest version of Beautiful Soup 4 from the download site, as the book suggested.
 
I

Ian Kelly

Dear Ian,
The book does recommend to use Python 2.7 (see bottom line of page 10).
The book also recommends to use Beautiful Soup 4.
You are right that in that I have placed the unzipped BS4 folder within a folder, and I therefore removed the contents of the inner folder and transferred them to the outer folder.
The console now can access the contents of the Beautiful Soup folder, but it is still having problems with it as the last output to my console demonstrates :


Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install
running install
running build
running build_py
error: package directory 'bs4' does not exist

In the same folder where setup.py is, there should be a bs4 folder.
You might want to just wipe your Beautiful Soup directory and do a
clean unzip.
 
S

Simon Evans

I have removed the original Beautiful Soup 4 download, that I had unzipped to my Beautiful Soup directory on the C drive.
I downloaded the latest version of Beautiful Soup 4 from the Crummy site.
I unzipped it, and removed the contents of the unzipped directory and placed contents in my Beautiful Soup directory, and again had the same output to my console re:
--------------------------------------------------------------------------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install

c:\Beautiful Soup>
-------------------------------------------------------------------------------
I have made a note of all the contents of the downloaded and unzipped BS4,ie the contents of my Beautiful Soup folder on the C drive, which is as follows:
-------------------------------------------------------------------------------
running install
running build
running build_py
error: package directory 'bs4' does not existinit
_html5lib
_htmlparser
_lxml
6.1
AUTHORS
conf
COPYING
dammit
demonstration_markup
element
index.rst
Makefile
NEWS
PGK-INFO
README
setup
test_builder_registry
test_docs
test_html5lib
test_htmlparser
text_lxml
test_soup
test_tree
testing
TODO
--------------------------------------------------------------------------------
I can see no bs4 folder within the contents.
I can not see any setup.py file either, but this is how I downloaded it.
I am only following instructions as suggested.
I do not understand why it is not working.
I hope someone can direct me in the right direction, as I seem to be stuck, and I don't think it has much bearing on my fluency or lack of it with Python.
 
S

Simon Evans

Dear Ian, and other programmers, thank you for your advice.
I am resending the last message because this twattish cut and paste facility on my computer has a knack of chopping off ones original message, I will try to convey the right message this time :

I have removed the original Beautiful Soup 4 download, that I had unzipped to my Beautiful Soup directory on the C drive.
I downloaded the latest version of Beautiful Soup 4 from the Crummy site.
I unzipped it, and removed the contents of the unzipped directory and placed contents in my Beautiful Soup directory, and again had the same output to my console re:
--------------------------------------------------------------------------------

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install

running install
running build
running build_py
error: package directory 'bs4' does not exist


c:\Beautiful Soup>
-------------------------------------------------------------------------------
I have made a note of all the contents of the downloaded and unzipped BS4,ie the contents of my Beautiful Soup folder on the C drive, which is as follows:
-------------------------------------------------------------------------------

running install
running build
running build_py

error: package directory 'bs4' does not existinit
_html5lib
_htmlparser
_lxml
6.1
AUTHORS
conf
COPYING
dammit
demonstration_markup
element
index.rst
Makefile
NEWS
PGK-INFO
README
setup
test_builder_registry
test_docs
test_html5lib
test_htmlparser
text_lxml
test_soup
test_tree
testing
TODO
--------------------------------------------------------------------------------
I can see no bs4 folder within the contents.
I can not see any setup.py file either, but this is how I downloaded it.
I am only following instructions as suggested.
I do not understand why it is not working.
I hope someone can direct me in the right direction, as I seem to be stuck, and I don't think it has much bearing on my fluency or lack of it with Python.
 
M

MRAB

Dear Ian, and other programmers, thank you for your advice.
I am resending the last message because this twattish cut and paste facility on my computer has a knack of chopping off ones original message, I will try to convey the right message this time :

I have removed the original Beautiful Soup 4 download, that I had unzipped to my Beautiful Soup directory on the C drive.
I downloaded the latest version of Beautiful Soup 4 from the Crummy site.
I unzipped it, and removed the contents of the unzipped directory and placed contents in my Beautiful Soup directory, and again had the same output to my console re:
--------------------------------------------------------------------------------

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install

running install
running build
running build_py
error: package directory 'bs4' does not exist


c:\Beautiful Soup>
-------------------------------------------------------------------------------
I have made a note of all the contents of the downloaded and unzipped BS4,ie the contents of my Beautiful Soup folder on the C drive, which is as follows:
-------------------------------------------------------------------------------

running install
running build
running build_py

error: package directory 'bs4' does not existinit
_html5lib
_htmlparser
_lxml
6.1
AUTHORS
conf
COPYING
dammit
demonstration_markup
element
index.rst
Makefile
NEWS
PGK-INFO
README
setup
test_builder_registry
test_docs
test_html5lib
test_htmlparser
text_lxml
test_soup
test_tree
testing
TODO
--------------------------------------------------------------------------------
I can see no bs4 folder within the contents.
I can not see any setup.py file either, but this is how I downloaded it.
I am only following instructions as suggested.
I do not understand why it is not working.
I hope someone can direct me in the right direction, as I seem to be stuck, and I don't think it has much bearing on my fluency or lack of it with Python.

I think I see your problem: you've unpacked everything into a single
folder instead of a folder hierarchy.

(It also looks like you have Explorer configured to hide the file
extensions. That's generally _not_ recommended.)


Try this:

#! python3.4
# -*- coding: utf-8 -*-
from os.path import splitext
import gzip
import tarfile

# The path of the downloaded file.
tar_gz_path = r'C:\beautifulsoup4-4.3.2.tar.gz'

# Unpack the .tar.gz file to a .tar file.
tar_path, ext = splitext(tar_gz_path)

with gzip.open(tar_gz_path, 'rb') as from_file:
with open(tar_path, 'wb') as to_file:
chunk = from_file.read()
to_file.write(chunk)

# Unpack the .tar file to a folder.
folder, ext = splitext(tar_path)

tar = tarfile.open(tar_path)
tar.extractall(folder)
tar.close()
 
I

Ian Kelly

I can see no bs4 folder within the contents.
I can not see any setup.py file either, but this is how I downloaded it.

You do have a setup.py in there, but your Windows explorer is showing
it to you without the .py extension. Something unusual is happening
with the download/extraction process though and you're missing the
correct folder structure. If you take a look here, you can see what
you *should* have after unzipping:

http://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/files

This approach seems to be unproductive though, so I'm going to second
Mark's suggestion to just use pip:

1) Go to pip-installer.org and download the single file get-pip.py
2) Open a command prompt and cd to the folder you downloaded that file into.
3) python get-pip.py
4) pip install beautifulsoup4

And then you should finally be ready to get started. Good luck!
 
M

Mark Lawrence

You do have a setup.py in there, but your Windows explorer is showing
it to you without the .py extension. Something unusual is happening
with the download/extraction process though and you're missing the
correct folder structure. If you take a look here, you can see what
you *should* have after unzipping:

http://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/files

This approach seems to be unproductive though, so I'm going to second
Mark's suggestion to just use pip:

1) Go to pip-installer.org and download the single file get-pip.py
2) Open a command prompt and cd to the folder you downloaded that file into.
3) python get-pip.py
4) pip install beautifulsoup4

And then you should finally be ready to get started. Good luck!

To be fair Terry Reedy has suggested pip at least twice, I've just given
another source of data on how to get pip in the first place.
 
S

Simon Evans

I downloaded the get-pip.py file. I installed it to the same folder on my Cdrive as the Beautiful Soup one in which the Beautiful Soup 4 downloads was unzipped to. I changed directory to the folder on the Command Prompt, as you instructed in step 2. I input the code to the console you gave on step 3), that returned some code, as quoted below. I then input the code you gave on step 4) but Console seems to reject or not recognise 'pip' as a term. I am sure quoting the actual prompt response can explain things better thanI :
-------------------------------------------------------------------------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.


C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>python get-pip.py
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pi
p-1.5.5-py2.py3-none-any.whl#md5=03a932d6f82a3887d8de1cdb837c87ed
Installing collected packages: pip
Found existing installation: pip 1.5.4
Uninstalling pip:
Successfully uninstalled pip
Successfully installed pip
Cleaning up...

c:\Beautiful Soup>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.

c:\Beautiful Soup>
 
S

Simon Evans

I have input the above code by copy and pasting to the Idle python console,as the python 2.7 command prompt is fussy about the indentation on the eleventh line down, if I then indent it, it replies that the indentation is unnecessary of unexpected, and if I don't it says an indentation is expected.
However when I get to the next lines of code - in the Idle prompt re:

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install

Again it does not recognise 'bs4'. I think having used 'Just unzip it' instead of 'WinZip' may have caused this problem, in the first place ,as when Ilooked at the WinZip version at a local net café, it did have a folder hierarchy, however I wanted, and still want to skimp the £25 fee for WinZip, which nowadays you can't seem to be able to do. I never asked for the darn files to be zipped, so why ought I pay to have them unzipped, being my contention.
 
I

Ian Kelly

c:\Beautiful Soup>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.

c:\Beautiful Soup>

No, sounds like a path environment variable issue. The python
executable is on your path, but the pip executable is not. The
get-pip.py script should have installed it into C:\Python27\Scripts, I
think, so either add that directory to your path (you can find
instructions for this on the web) or just cd to that directory and run
the pip command from there.
 
I

Ian Kelly

On Wed, May 14, 2014 at 1:28 PM, Simon Evans > Again it does not
recognise 'bs4'. I think having used 'Just unzip it' instead of
'WinZip' may have caused this problem, in the first place ,as when I
looked at the WinZip version at a local net café, it did have a folder
hierarchy, however I wanted, and still want to skimp the £25 fee for
WinZip, which nowadays you can't seem to be able to do. I never asked
for the darn files to be zipped, so why ought I pay to have them
unzipped, being my contention.

I use 7-zip (www.7-zip.org), which is freely distributed and open source.
 
S

Simon Evans

Dear Programmers,
I downloaded Peazip, which doesn't remove file/ folder hierarchy. I unzipped it and input the same code to the console and it installed Beautiful Soup 4 okay re:-
---------------------------------------------------------------------------------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Intel Atom>cd "c:\Beautiful Soup"

c:\Beautiful Soup>c:\Python27\python setup.py install
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\bs4
copying bs4\dammit.py -> build\lib\bs4
copying bs4\element.py -> build\lib\bs4
copying bs4\testing.py -> build\lib\bs4
copying bs4\__init__.py -> build\lib\bs4
creating build\lib\bs4\builder
copying bs4\builder\_html5lib.py -> build\lib\bs4\builder
copying bs4\builder\_htmlparser.py -> build\lib\bs4\builder
copying bs4\builder\_lxml.py -> build\lib\bs4\builder
copying bs4\builder\__init__.py -> build\lib\bs4\builder
creating build\lib\bs4\tests
copying bs4\tests\test_builder_registry.py -> build\lib\bs4\tests
copying bs4\tests\test_docs.py -> build\lib\bs4\tests
copying bs4\tests\test_html5lib.py -> build\lib\bs4\tests
copying bs4\tests\test_htmlparser.py -> build\lib\bs4\tests
copying bs4\tests\test_lxml.py -> build\lib\bs4\tests
copying bs4\tests\test_soup.py -> build\lib\bs4\tests
copying bs4\tests\test_tree.py -> build\lib\bs4\tests
copying bs4\tests\__init__.py -> build\lib\bs4\tests
running install_lib
creating c:\Python27\Lib\site-packages\bs4
creating c:\Python27\Lib\site-packages\bs4\builder
copying build\lib\bs4\builder\_html5lib.py -> c:\Python27\Lib\site-packages\bs4\
builder
copying build\lib\bs4\builder\_htmlparser.py -> c:\Python27\Lib\site-packages\bs
4\builder
copying build\lib\bs4\builder\_lxml.py -> c:\Python27\Lib\site-packages\bs4\buil
der
copying build\lib\bs4\builder\__init__.py -> c:\Python27\Lib\site-packages\bs4\b
uilder
copying build\lib\bs4\dammit.py -> c:\Python27\Lib\site-packages\bs4
copying build\lib\bs4\element.py -> c:\Python27\Lib\site-packages\bs4
copying build\lib\bs4\testing.py -> c:\Python27\Lib\site-packages\bs4
creating c:\Python27\Lib\site-packages\bs4\tests
copying build\lib\bs4\tests\test_builder_registry.py -> c:\Python27\Lib\site-pac
kages\bs4\tests
copying build\lib\bs4\tests\test_docs.py -> c:\Python27\Lib\site-packages\bs4\te
sts
copying build\lib\bs4\tests\test_html5lib.py -> c:\Python27\Lib\site-packages\bs
4\tests
copying build\lib\bs4\tests\test_htmlparser.py -> c:\Python27\Lib\site-packages\
bs4\tests
copying build\lib\bs4\tests\test_lxml.py -> c:\Python27\Lib\site-packages\bs4\te
sts
copying build\lib\bs4\tests\test_soup.py -> c:\Python27\Lib\site-packages\bs4\te
sts
copying build\lib\bs4\tests\test_tree.py -> c:\Python27\Lib\site-packages\bs4\te
sts
copying build\lib\bs4\tests\__init__.py -> c:\Python27\Lib\site-packages\bs4\tes
ts
copying build\lib\bs4\__init__.py -> c:\Python27\Lib\site-packages\bs4
byte-compiling c:\Python27\Lib\site-packages\bs4\builder\_html5lib.py to _html5l
ib.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\builder\_htmlparser.py to _html
parser.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\builder\_lxml.py to _lxml.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\builder\__init__.py to __init__
..pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\dammit.py to dammit.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\element.py to element.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\testing.py to testing.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_builder_registry.py
to test_builder_registry.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_docs.py to test_docs
..pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_html5lib.py to test_
html5lib.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_htmlparser.py to tes
t_htmlparser.pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_lxml.py to test_lxml
..pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_soup.py to test_soup
..pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\test_tree.py to test_tree
..pyc
byte-compiling c:\Python27\Lib\site-packages\bs4\tests\__init__.py to __init__.p
yc
byte-compiling c:\Python27\Lib\site-packages\bs4\__init__.py to __init__.pyc
running install_egg_info
Writing c:\Python27\Lib\site-packages\beautifulsoup4-4.1.0-py2.7.egg-info

c:\Beautiful Soup>
 
S

Simon Evans

Dear Programmers,
As anticipated, it has not been to long before I have encountered further

difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it

gives code to be input, whether to the Python or Windows command prompt I am not

sure, but both seem to be resistant to it. I quote the response to the code below,

the code input being :-

helloworld = "<p>Hello World</p>"
soup_string = BeautifulSoup(helloworld)

to Windows Command prompt this gives :-
----------------------------------------------------------------------------------
SyntaxError: invalid syntaxTraceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'BeautifulSoup' is not defined
----------------------------------------------------------------------------------
I have been told by one of the programmers, that I ought be inputting this to the

Python command prompt (the book doesn't spacify), but that doesn't take either

re:-
----------------------------------------------------------------------------------Traceback (most recent call last):
----------------------------------------------------------------------------------
Looking at the bottom of page 16, there is more code for the inputting of, that

again does not take to the Windows Command Prompt or the Python command prompt,
re: import urllib2
from bs4 import BeautifulSoup
url = "http://www.packtpub.com/books"
page = urllib2.urlopen(url)
soup_packtpage = BeautifulSoup(page)

returns to the Windows Command prompt:-
----------------------------------------------------------------------------------Traceback (most recent call last):

----------------------------------------------------------------------------------
returns to the Python command prompt :-
----------------------------------------------------------------------------------Traceback (most recent call last):
File "C\Python27\lib\urllib2.py",line 127, in urlopen
return_opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py",line 410, in open
response = meth(req, response)
File "C:\Pyton27\lib\urllib2.py", oine 523, in http_response
'http', request, response, code, msg, hdrs)
File"C:\Python27\lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "C:/Python27/lib/urllib2.py",line 382, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, masg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
---------------------------------------------------------------------------------
Anway I hope you can tell me what is amiss, there is no point in my proceeding

with the book (about 111 pages all told) until I find out why it won't take.
I realise I have been told to learn python in order to make things less painful,

but I don't see why code written in the book does not take.
Thank you for reading.





I thought I might as well include, so's you might be able to see where things are

going astray. The Windows command prompt :-
 
S

Simon Evans

Dear Programmers, I noticed a couple of typos in my previous message, so have now altered them thus :-

Dear Programmers,
As anticipated, it has not been to long before I have encountered further

difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it

gives code to be input, whether to the Python or Windows command prompt I am not

sure, but both seem to be resistant to it. I quote the response to the code below,

the code input being :-

helloworld = "<p>Hello World</p>"
soup_string = BeautifulSoup(helloworld)

to Windows Command prompt this gives :-
----------------------------------------------------------------------------------
SyntaxError: invalid syntaxTraceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'BeautifulSoup' is not defined
----------------------------------------------------------------------------------
I have been told by one of the programmers, that I ought be inputting this to the

Python command prompt (the book doesn't spacify), but that doesn't take either

re:-
----------------------------------------------------------------------------------Traceback (most recent call last):
----------------------------------------------------------------------------------
Looking at the bottom of page 16, there is more code for the inputting of, that

again does not take to the Windows Command Prompt or the Python command prompt,
re: import urllib2
from bs4 import BeautifulSoup
url = "http://www.packtpub.com/books"
page = urllib2.urlopen(url)
soup_packtpage = BeautifulSoup(page)

returns to the Windows Command prompt:-
----------------------------------------------------------------------------------Traceback (most recent call last):

----------------------------------------------------------------------------------
returns to the Python command prompt :-
----------------------------------------------------------------------------------Traceback (most recent call last):
File "C\Python27\lib\urllib2.py",line 127, in urlopen
return_opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py",line 410, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", oine 523, in http_response
'http', request, response, code, msg, hdrs)
File"C:\Python27\lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "C:/Python27/lib/urllib2.py",line 382, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, masg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
---------------------------------------------------------------------------------
Anway I hope you can tell me what is amiss, there is no point in my proceeding

with the book (about 111 pages all told) until I find out why it won't take.
I realise I have been told to learn python in order to make things less painful,

but I don't see why code written in the book does not take.
Thank you for reading.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top