top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How do I access 'Beautiful Soup' on python?

+1 vote
389 views

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 Beautiful Soup to a folder of the same name on my C drive, in accordance with the first two steps of page 12 of the aforementioned publication, but proceeding to navigate to the program as in step three, re: "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 returns on my Python 27 :
>>> cd Beautiful Soup
File "",line 1
cd Beautiful Soup
 ^
SyntaxError: invalid syntax
>>>

also I get:
>>> cd Beautiful Soup
SyntaxError: invalid syntax
>>>

to my IDLE Python 2.7 version, same goes for the Python 3.4 installations. Hope someone can help.

posted May 10, 2014 by Sonu Jindal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

This would be the operating system command line, not Python's interactive mode. Since you refer to a C drive, I'm going to assume Windows; you'll want to open up "Command Prompt", or cmd.exe, or whatever name your version of Windows buries it under. (Microsoft does not make it particularly easy on you.) Since you have a space in the name, you'll need quotes:

cd "c:Beautiful Soup"

Then proceed as per the instructions.

answer May 10, 2014 by anonymous
Similar Questions
+1 vote

I am writing a simple tool that needs to read the serial number of a remote SSL certificate. I've poked around Google for a bit but can't find anything that fits the bill.

Is this possible in Python? If so, would someone point me in the general direction of how to do it?

+4 votes

Probably I'm turning the use of regular expressions upside down with this question. I don't want to write a regex that matches prefixes of other strings, I know how to do that. I want to generate a regex -- given another regex --, that matches all possible strings that are a prefix of a string that matches the given regex.

E.g. You have the regex ^[a-z]*4R$ then the strings "a", "ab", "A4" "ab4" are prefixes of this regex (because there is a way of adding characters that causes the regex to match), but "4a" or "a44" or not.
How do I programmatically create a regex that matches "a", "ab", "A4", etc.. but not "4a", "a44", etc..

Logically, I'd think it should be possible by running the input string against the state machine that the given regex describes, and if at some point all the input characters are consumed, it's a match. (We don't have to run the regex until the end.) But I cannot find any library that does it...

...