Re: Beautiful Soup - close tags more promptly?

2022-10-25 Thread Chris Angelico
On Wed, 26 Oct 2022 at 04:59, Tim Delaney wrote: > > On Mon, 24 Oct 2022 at 19:03, Chris Angelico wrote: >> >> >> Ah, cool. Thanks. I'm not entirely sure of the various advantages and >> disadvantages of the different parsers; is there a tabulation >> anywhere, or at least a list of recommendatio

Re: Beautiful Soup - close tags more promptly?

2022-10-25 Thread Tim Delaney
On Mon, 24 Oct 2022 at 19:03, Chris Angelico wrote: > > Ah, cool. Thanks. I'm not entirely sure of the various advantages and > disadvantages of the different parsers; is there a tabulation > anywhere, or at least a list of recommendations on choosing a suitable > parser? > Coming to this a bit

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Tue, 25 Oct 2022 at 09:34, Peter J. Holzer wrote: > > One thing I find quite interesting, though, is the way that browsers > > *differ* in the face of bad nesting of tags. Recently I was struggling > > to figure out a problem with an HTML form, and eventually found that > > there was a spurious

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-25 06:56:58 +1100, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 04:22, Peter J. Holzer wrote: > > There may be several reasons: > > > > * Historically, some browsers differed in which end tags were actually > > optional. Since (AFAIK) no mainstream browser ever implemented a real >

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Tue, 25 Oct 2022 at 04:22, Peter J. Holzer wrote: > There may be several reasons: > > * Historically, some browsers differed in which end tags were actually > optional. Since (AFAIK) no mainstream browser ever implemented a real > SGML parser (they were always "tag soup" parsers with lots o

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
Jon Ribbens via Python-list schreef op 24/10/2022 om 19:01: On 2022-10-24, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 02:45, Jon Ribbens via Python-list wrote: >> Adding in the omitted , , , , and >> would make no difference and there's no particular reason to recommend >> doing so as fa

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-25 03:09:33 +1100, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 02:45, Jon Ribbens via Python-list > wrote: > > On 2022-10-24, Chris Angelico wrote: > > > On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: > > >> Yes, I got that. What I wanted to say was that this is indeed a bug

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Jon Ribbens via Python-list
On 2022-10-24, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 02:45, Jon Ribbens via Python-list > wrote: >> >> On 2022-10-24, Chris Angelico wrote: >> > On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: >> >> Yes, I got that. What I wanted to say was that this is indeed a bug in >> >> html.p

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Tue, 25 Oct 2022 at 02:45, Jon Ribbens via Python-list wrote: > > On 2022-10-24, Chris Angelico wrote: > > On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: > >> Yes, I got that. What I wanted to say was that this is indeed a bug in > >> html.parser and not an error (or sloppyness, as you

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Jon Ribbens via Python-list
On 2022-10-24, Chris Angelico wrote: > On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: >> Yes, I got that. What I wanted to say was that this is indeed a bug in >> html.parser and not an error (or sloppyness, as you called it) in the >> input or ambiguity in the HTML standard. > > I describe

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: > > On 2022-10-24 21:56:13 +1100, Chris Angelico wrote: > > On Mon, 24 Oct 2022 at 21:33, Peter J. Holzer wrote: > > > Ron has already noted that the lxml and html5 parser do the right thing, > > > so just for the record: > > > > > > The HTML f

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 21:56:13 +1100, Chris Angelico wrote: > On Mon, 24 Oct 2022 at 21:33, Peter J. Holzer wrote: > > Ron has already noted that the lxml and html5 parser do the right thing, > > so just for the record: > > > > The HTML fragment above is well-formed and contains a number of li > > element

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Mon, 24 Oct 2022 at 21:33, Peter J. Holzer wrote: > Ron has already noted that the lxml and html5 parser do the right thing, > so just for the record: > > The HTML fragment above is well-formed and contains a number of li > elements at the same level directly below the ol element, not lots of >

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 12:32:11 +0200, Peter J. Holzer wrote: > Ron has already noted that the lxml and html5 parser do the right thing, ^^^ Oops, sorry. That was Roel. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 13:29:13 +1100, Chris Angelico wrote: > Parsing ancient HTML files is something Beautiful Soup is normally > great at. But I've run into a small problem, caused by this sort of > sloppy HTML: > > from bs4 import BeautifulSoup > # See: https://gsarchive.net

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
arious advantages and disadvantages of the different parsers; is there a tabulation anywhere, or at least a list of recommendations on choosing a suitable parser? There's a bit of information here: https://beautiful-soup-4.readthedocs.io/en/latest/#installing-a-parser Not much but maybe it ca

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
Op 24/10/2022 om 9:42 schreef Roel Schroeven: Using html5lib (install package html5lib) instead of html.parser seems to do the trick: it inserts right before the next , and one before the closing . On my system the same happens when I don't specify a parser, but IIRC that's a bit fragile beca

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Mon, 24 Oct 2022 at 18:43, Roel Schroeven wrote: > > Op 24/10/2022 om 4:29 schreef Chris Angelico: > > Parsing ancient HTML files is something Beautiful Soup is normally > > great at. But I've run into a small problem, caused by this sort of > > sloppy

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
Op 24/10/2022 om 4:29 schreef Chris Angelico: Parsing ancient HTML files is something Beautiful Soup is normally great at. But I've run into a small problem, caused by this sort of sloppy HTML: from bs4 import BeautifulSoup # See: https://gsarchive.net/gilbert/plays/princess/tennyson/tenni

Beautiful Soup - close tags more promptly?

2022-10-23 Thread Chris Angelico
Parsing ancient HTML files is something Beautiful Soup is normally great at. But I've run into a small problem, caused by this sort of sloppy HTML: from bs4 import BeautifulSoup # See: https://gsarchive.net/gilbert/plays/princess/tennyson/tenniv.htm blob = b""" 'THERE s

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Mark Lawrence
On 12/07/2015 21:29, Laura Creighton wrote: In a message of Sun, 12 Jul 2015 21:09:22 +0100, Mark Lawrence writes: On 12/07/2015 20:47, Laura Creighton wrote: Simon Evans -- what editor are you using to write your Python code with? Laura Creighton Editor? His earlier posts clearly show he'

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Laura Creighton
In a message of Sun, 12 Jul 2015 21:09:22 +0100, Mark Lawrence writes: >On 12/07/2015 20:47, Laura Creighton wrote: >> Simon Evans -- what editor are you using to write your Python code with? >> >> Laura Creighton >> > >Editor? His earlier posts clearly show he's using the 2.7.6 32 bit >interacti

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Larry Hudson via Python-list
On 07/12/2015 05:48 AM, Simon Evans wrote: Dear Peter Otten, Yes, I have been copying and pasting, as it saves typing. I do get 'indented block' error responses as a small price > to pay for the time and energy thus saved. > You CANNOT ignore indenting. Indenting is NOT optional, it is REQUIRED

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Mark Lawrence
On 12/07/2015 20:47, Laura Creighton wrote: Simon Evans -- what editor are you using to write your Python code with? Laura Creighton Editor? His earlier posts clearly show he's using the 2.7.6 32 bit interactive interpreter on Windows. -- My fellow Pythonistas, ask not what our language c

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Laura Creighton
Simon Evans -- what editor are you using to write your Python code with? Laura Creighton -- https://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Albert Visser
: Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. from bs4 import BeautifulSoup with open("C:\Beautiful Soup\ecologicalpyramid.html","r&quo

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Mark Lawrence
, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. from bs4 import BeautifulSoup with open("C:\Beautiful Soup\ecologicalpyramid.html","r")as f: ...

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread MRAB
, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. from bs4 import BeautifulSoup with open("C:\Beautiful Soup\ecologicalpyramid.html","r")as f: ...

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Chris Angelico
On Mon, Jul 13, 2015 at 3:54 AM, Laurent Pointal wrote: > Double \ in your string: > "C:\\Beautiful Soup\\ecologicalpyramid.html" > > Or use a raw string by prepending a r to disable escape sequences: > r"C:\Beautiful Soup\ecologicalpyramid.html&qu

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Laurent Pointal
Simon Evans wrote: > - >>>> with open("C:\Beautiful Soup\ecologicalpyramid.html","r") as You seem to run Python under Windows. You have to take care of escape mechanism beyond \ char in strin

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
(Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> from bs4 import BeautifulSoup >>> with open("C:\Beautiful Soup\ecologicalpyramid.html","r")as f: ... sou

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Peter Otten
Simon Evans wrote: > Dear Peter Otten, > Yes, I have been copying and pasting, as it saves typing. I do get > 'indented block' error responses as a small price to pay for the time and > energy thus saved. Also Console seems to reject for 'indented block' > reasons better known to itself, copy and

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Peter Otten, Yes, I have been copying and pasting, as it saves typing. I do get 'indented block' error responses as a small price to pay for the time and energy thus saved. Also Console seems to reject for 'indented block' reasons better known to itself, copy and pasted lines that it accep

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
- Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> from bs4 import BeautifulSoup >>> soup = BeautifulSoup("C:\Beautiful

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Peter Otten
8) [MSC v.1500 32 bit (Intel)] > on win 32 > Type "help", "copyright", "credits" or "license" for more information. > >>>> from bs4 import BeautifulSoup >>>> with open("C:\Beautiful Soup\ecologicalpyramid.html","r&q

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
lp", "copyright", "credits" or "license" for more information. >>> from bs4 import BeautifulSoup >>> with open("C:\Beautiful Soup\ecologicalpyramid.html","r")as f: >>> soup = BeautifulSoup(f, "lxml")

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Peter Otten
Simon Evans wrote: > Dear Mark Lawrence, thank you for your advice. > I take it that I use the input you suggest for the line : > > soup = BeautifulSoup("C:\Beautiful Soup\ecological_pyramid.html",lxml") > > seeing as I have to give the file's full add

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Mark Lawrence, thank you for your advice. I take it that I use the input you suggest for the line : soup = BeautifulSoup("C:\Beautiful Soup\ecological_pyramid.html",lxml") seeing as I have to give the file's full address I therefore have to modify your :

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-11 Thread Mark Lawrence
'EcologicalPyramid.html' Thank you in advance for your help. ----- with open("C:\Beautiful Soup\ecologicalpyramid.html","r") as ecological_pyramid: soup = BeautifulSoup("C:\Beautiful Soup\ecological_pyramid.html","lxml") Beautiful Soup takes a

Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-11 Thread Simon Evans
hich is also in the documents text, but that is the word the code is meant to elicit. I enclose the pertinent code as input and output from the console, and the html code for the document 'EcologicalPyramid.html' Thank you in advance for your help. ----

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-14 Thread Chris Angelico
On Mon, Dec 15, 2014 at 1:48 AM, Simon Evans wrote: > Thanks Guys > This book keeps swapping from the Python console to the Windows - without > telling you, but it is the only book out there on 'Beautiful Soup' so I have > got to put up with it. There's more problems

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-14 Thread Simon Evans
Thanks Guys This book keeps swapping from the Python console to the Windows - without telling you, but it is the only book out there on 'Beautiful Soup' so I have got to put up with it. There's more problems with it, but I will start a new thread in regard of, I don't kn

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread Dave Angel
On 12/11/2014 02:40 PM, Chris Angelico wrote: On Fri, Dec 12, 2014 at 6:34 AM, Dave Angel wrote: Please give your environment when starting a new thread. Python version and OS version. In this case, I'm guessing Windows, because I have to guess something to give a meaningful answer. On 12/11

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread Chris Angelico
On Fri, Dec 12, 2014 at 6:34 AM, Dave Angel wrote: > Please give your environment when starting a new thread. Python version and > OS version. In this case, I'm guessing Windows, because I have to guess > something to give a meaningful answer. > > On 12/11/2014 02:21 PM, Simon Evans wrote: >> Py

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread Dave Angel
Please give your environment when starting a new thread. Python version and OS version. In this case, I'm guessing Windows, because I have to guess something to give a meaningful answer. On 12/11/2014 02:21 PM, Simon Evans wrote: At the start of Chapter 3 of 'Getting Started in

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread sohcahtoa82
On Thursday, December 11, 2014 11:21:52 AM UTC-8, Simon Evans wrote: > At the start of Chapter 3 of 'Getting Started in Beautiful Soup' it has said > to create a html file, 'ecological > > pyramid.html'

Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread Simon Evans
At the start of Chapter 3 of 'Getting Started in Beautiful Soup' it has said to create a html file, 'ecological pyramid.html' - which I have already done re: plants 10 algae 10

Re: Tag objects in Beautiful Soup

2014-11-20 Thread Denis McMahon
On Thu, 20 Nov 2014 06:31:08 -0800, Simon Evans wrote: > Can anyone tell me where I am going wrong or where the text is wrong ? > So far the given code has run okay, I have put to the console everything > the text tells you to. Thank you for reading. > Simon Evans Having looked at the ebook, ther

Re: Tag objects in Beautiful Soup

2014-11-20 Thread Peter Otten
Simon Evans wrote: > Re:'Accessing the Tag object from Beautiful Soup' (page 22-25 - Getting > Started with Beautiful Soup) So far the code to python27 runs as given in > the book, re: - > >>

Tag objects in Beautiful Soup

2014-11-20 Thread Simon Evans
Re:'Accessing the Tag object from Beautiful Soup' (page 22-25 - Getting Started with Beautiful Soup) So far the code to python27 runs as given in the book, re: - >>> html_atag = ""&quo

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

2014-05-15 Thread Rustom Mody
On Thursday, May 15, 2014 4:55:42 PM UTC+5:30, Simon Evans wrote: > 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 c

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

2014-05-15 Thread Dave Angel
Beautiful Soup installed and working. If you can successfully import it, you're ready for a new thread, new subject line, etc. Note the new thread's opener should be self-contained, meaning you should mention the environment (version of BS, version of Python, version of what OS)

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

2014-05-15 Thread 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

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

2014-05-15 Thread 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 re

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

2014-05-15 Thread 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 [Ve

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

2014-05-14 Thread Chris Angelico
On Thu, May 15, 2014 at 5:33 AM, Ian Kelly wrote: > I use 7-zip (www.7-zip.org), which is freely distributed and open source. You beat me to the punch. :) Was about to say the exact same thing, so instead I'll second your recommendation. ChrisA -- https://mail.python.org/mailman/listinfo/python

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

2014-05-14 Thread 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, a

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

2014-05-14 Thread Ian Kelly
On Wed, May 14, 2014 at 12:58 PM, Simon Evans wrote: > c:\Beautiful Soup>pip install beautifulsoup4 > 'pip' is not recognized as an internal or external command, > operable program or batch file.

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

2014-05-14 Thread Simon Evans
on 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

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

2014-05-14 Thread Simon Evans
I downloaded the get-pip.py file. I installed it to the same folder on my C drive 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

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

2014-05-13 Thread Mark Lawrence
On 13/05/2014 17:33, Ian Kelly wrote: On Tue, May 13, 2014 at 5:59 AM, Simon Evans wrote: 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 witho

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

2014-05-13 Thread Ian Kelly
On Tue, May 13, 2014 at 5:59 AM, Simon Evans wrote: > 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 unusu

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

2014-05-13 Thread MRAB
: 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

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

2014-05-13 Thread Mark Lawrence
On 13/05/2014 12:59, Simon Evans wrote: I suggest that you follow the instructions here http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows to get pip, then let pip do the work for you as that's what it's designed for :) -- My fellow Pythonistas, ask not what our languag

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

2014-05-13 Thread Simon Evans
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

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

2014-05-13 Thread 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

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

2014-05-12 Thread Ian Kelly
On Mon, May 12, 2014 at 10:35 AM, Simon Evans wrote: > 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,

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

2014-05-12 Thread Simon Evans
I did download the latest version of Beautiful Soup 4 from the download site, as the book suggested. -- https://mail.python.org/mailman/listinfo/python-list

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

2014-05-12 Thread 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

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

2014-05-12 Thread 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 am going 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 t

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

2014-05-12 Thread 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 of

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

2014-05-12 Thread 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

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

2014-05-11 Thread Rustom Mody
On Saturday, May 10, 2014 10:28:18 PM UTC+5:30, Simon Evans wrote: > I am new to Python, but my main interest is to use it to Webscrape. I guess you've moved on from this specific problem. However here is some general advice: To use beautiful soup you need to use python. To use python

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

2014-05-11 Thread Chris Angelico
On Mon, May 12, 2014 at 6:31 AM, Terry Reedy wrote: > Please do not advise people to unnecessarily downgrade to 2.7 ;-). > Simon just needs the proper current version of BeautifulSoup. > BeautifulSoup3 does not work with 3.x. > BeautifulSoup4 works with 2.6+ and 3.x. > http://www.crummy.com/softwa

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

2014-05-11 Thread Ian Kelly
g-Started-Beautiful-Soup-Vineeth/dp/1783289554 then it says to use Python 2.7.5 or greater. There is no indication that the book is targeted at Python 3, and in fact I see at least one line that won't work in Python 3 ("import urllib2"), so I definitely recommend sticking with

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

2014-05-11 Thread Terry Reedy
On 5/11/2014 6:03 PM, Simon Evans wrote: I have downloaded Beautiful Soup 3, I am using Python 2.7. I understand from your message that I ought to use Python 2.6or Python 3.4 with Beautiful Soup 4, I wrote "BeautifulSoup4 works with 2.6+ and 3.x.". '2.6+' means 2.6 or 2.

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

2014-05-11 Thread Ian Kelly
> C:\Users\Intel Atom>cd "c:\Beautiful Soup" > > c:\Beautiful Soup>c:\Python27\python setup.py install > c:\Python27\python: can't open file 'setup.py': [Errno 2] No such file or > direct > ory > --

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

2014-05-11 Thread Simon Evans
- but wait a moment 'BeautifulSoup4 works with 2.6+ and 3.x'(Terry Reedy) - doesn't 2.6 + = 2.7, which is what I'm using with BeautifulSoup4. -- https://mail.python.org/mailman/listinfo/python-list

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

2014-05-11 Thread Simon Evans
test version of Beautiful Soup 4, but am again facing > problems with the second line of code, re:- > > --- > > > Microsoft Windows [Version 6.1.7601] > > Copyright (c) 2009 Microsoft Corporat

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

2014-05-11 Thread Simon Evans
Yeah well at no point does the book say to start inputting the code mentioned in Python command prompt rather than the Windows command prompt, but thank you for your guidance anyway. I have downloaded the latest version of Beautiful Soup 4, but am again facing problems with the second line of

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

2014-05-11 Thread MRAB
On 2014-05-11 23:03, Simon Evans wrote: I have downloaded Beautiful Soup 3, I am using Python 2.7. I understand from your message that I ought to use Python 2.6 or Python 3.4 with Beautiful Soup 4, the book I am using 'Getting Started with Beautiful Soup' is for Beautiful Soup 4. T

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

2014-05-11 Thread Simon Evans
I have downloaded Beautiful Soup 3, I am using Python 2.7. I understand from your message that I ought to use Python 2.6 or Python 3.4 with Beautiful Soup 4, the book I am using 'Getting Started with Beautiful Soup' is for Beautiful Soup 4. Therefore I gather I must re-download Beau

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

2014-05-11 Thread Terry Reedy
On 5/11/2014 3:17 PM, Chris Angelico wrote: On Mon, May 12, 2014 at 5:05 AM, Simon Evans wrote: c:\Beautiful Soup>python setup.py install. There is no need for a standalone Beautiful Soup directory. See below. File "setup.py", line 22 print "Unit

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

2014-05-11 Thread MRAB
:- 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 b

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

2014-05-11 Thread Simon Evans
:- 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 b

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

2014-05-11 Thread Chris Angelico
[Version 6.1.7601] > Copyright (c) 2009 Microsoft Corporation. All rights reserved. > > C:\Users\Intel Atom>cd"c:\Beautiful Soup" > The filename, directory name, or volume label syntax is incorrect. Command line syntax is always to put a command first (one word), and then

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

2014-05-11 Thread Simon Evans
plain things better than I :- Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Intel Atom>cd"c:\Beautiful Soup" The filename, directory name, or v

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

2014-05-10 Thread Dave Angel
On 05/10/2014 07:23 PM, Chris Angelico wrote: There is a broad convention that spaces in file names get protected with quotes, though (for instance, tab completion will put quotes around them), so it's not complete chaos. "Complete chaos" is a pretty good description, especially since MS dec

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

2014-05-10 Thread Chris Angelico
On Sun, May 11, 2014 at 4:39 AM, Terry Reedy wrote: >> Since you have a space in the name, you'll need quotes: >> >> >> cd "c:\Beautiful Soup" > > > Not for Win 7, at least > > C:\Users\Terry>cd \program files > > C:\Program Files&g

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

2014-05-10 Thread Terry Reedy
On 5/10/2014 1:03 PM, Chris Angelico wrote: On Sun, May 11, 2014 at 2:58 AM, Simon Evans wrote: "Open up the command line prompt and navigate to the folder where you have unzipped the folder as follows: cd Beautiful Soup python setup python install " This would be the operat

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

2014-05-10 Thread Chris Angelico
On Sun, May 11, 2014 at 2:58 AM, Simon Evans wrote: > "Open up the command line prompt and navigate to the folder where you have > unzipped the folder as follows: > cd Beautiful Soup > python setup python install " This would be the operating system command line, not Pyt

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

2014-05-10 Thread Simon Evans
I am new to Python, but my main interest is to use it to Webscrape. I have downloaded Beautiful Soup, and have followed the instruction in the 'Getting Started with Beautiful Soup' book, but my Python installations keep returning errors, so I can't get started. I have unzipped Be

Re: beautiful soup get class info

2014-03-12 Thread Peter Otten
Christopher Welborn wrote: > On 03/06/2014 02:22 PM, teddyb...@gmail.com wrote: >> I am using beautifulsoup to get the title and date of the website. >> title is working fine but I am not able to pull the date. Here is the >> code in the url: >> >> October 22, 2011 >> >> In Python, I am using th

Re: beautiful soup get class info

2014-03-11 Thread Christopher Welborn
On 03/06/2014 02:22 PM, teddyb...@gmail.com wrote: I am using beautifulsoup to get the title and date of the website. title is working fine but I am not able to pull the date. Here is the code in the url: October 22, 2011 In Python, I am using the following code: date1 = soup.span.text data=

Re: beautiful soup get class info

2014-03-06 Thread Mark Lawrence
On 07/03/2014 01:37, teddyb...@gmail.com wrote: On Thursday, March 6, 2014 4:28:06 PM UTC-6, John Gordon wrote: In writes: soup.find_all(name="span", class="date") I have python 2.7.2 and it does not like class in the code you provided. Oh right, 'class' is a reserved word. I ima

Re: beautiful soup get class info

2014-03-06 Thread teddybubu
On Thursday, March 6, 2014 4:28:06 PM UTC-6, John Gordon wrote: > In writes: > > > > > > soup.find_all(name="span", class="date") > > > > > I have python 2.7.2 and it does not like class in the code you provided. > > > > Oh right, 'class' is a reserved word. I imagine beautifulsoup has

Re: beautiful soup get class info

2014-03-06 Thread John Gordon
In teddyb...@gmail.com writes: > > soup.find_all(name="span", class="date") > I have python 2.7.2 and it does not like class in the code you provided. Oh right, 'class' is a reserved word. I imagine beautifulsoup has a workaround for that. > Now when I take out [ class="date"], this is retur

Re: beautiful soup get class info

2014-03-06 Thread teddybubu
On Thursday, March 6, 2014 2:58:12 PM UTC-6, John Gordon wrote: > In teddy writes: > > > > > October 22, 2011 > > > > > date1 = soup.span.text > > > data=soup.find_all(date="value") > > > > Try this: > > > > soup.find_all(name="span", class="date") > > > > -- > > John Gordon

Re: beautiful soup get class info

2014-03-06 Thread John Gordon
In teddyb...@gmail.com writes: > October 22, 2011 > date1 = soup.span.text > data=soup.find_all(date="value") Try this: soup.find_all(name="span", class="date") -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real se

beautiful soup get class info

2014-03-06 Thread teddybubu
I am using beautifulsoup to get the title and date of the website. title is working fine but I am not able to pull the date. Here is the code in the url: October 22, 2011 In Python, I am using the following code: date1 = soup.span.text data=soup.find_all(date="value") Results in: [] March 5,

  1   2   >