0

I wanted to write a program to scrape a website from python. Since there is no built-in possibility to do so, I decided to give the BeautifulSoup module a try.

Unfortunately I encountered some problems using pip and ez_install, since I use Windows 7 64 bit and Python 3.3.

Is there a way to get the BeautifulSoup module on my Python 3.3 installation with Windows 7 64x without ez_install or easy_install, since I have too much trouble with this, or is there an alternative module which can be easily installed?

CrushedPixel
  • 1,152
  • 2
  • 13
  • 26

3 Answers3

1

Just download here and then add the BeautifulSoup.py (uncompress the download tarball file use uncompress soft such as 7z) to your python sys.path use sys.path.append("/path/to/BeautifulSoup.py"), of cource you can just put it under your current src dir as a normal python module or put it in the pathon's sys path.

BTW the tarball install(or build) way is:

cd BeautifulSoup
python setup.py install(or build)

if you are using python3, you can dowload the bs4(look at the commetn under this answer), just let the bs4(in the tarball source dir) under your python's sys path and then

from bs4 import BeautifulSoup

good luck~

atupal
  • 16,404
  • 5
  • 31
  • 42
  • Unfortunately it still outputs me the default Python 2 - Python 3 incompatibility errors (like when it uses "print" or "raise")... Is there a version for Python 3 around? – CrushedPixel Sep 09 '13 at 18:38
  • oh, you need BeautifulSoup4, just donwload [here](http://www.crummy.com/software/BeautifulSoup/bs4/download/) or in the [pypi](https://pypi.python.org/pypi/beautifulsoup4). – atupal Sep 10 '13 at 00:55
1

You just need to add to download it and add it to your python search path directly. (Which is in sys.path, if you need to check it.)

From the documentation: Beautiful Soup is licensed under the MIT license, so you can also download the tarball, drop the bs4/ directory into almost any Python application (or into your library path) and start using it immediately. (If you want to do this under Python 3, you will need to manually convert the code using 2to3.)

aleatha
  • 808
  • 5
  • 7
  • Should be able to just do `2to3 -w *.py` which will create backups of the existing Python files, and then overwrite the existing files with the converted code. If that's not working, drop me a comment with the errors you're getting. – aleatha Sep 10 '13 at 13:31
0

I haven't tried it, but check out pip to install python packages. It's supposed to be better.

Why use pip over easy_install

I have personally used BeautifulSoup and like it. I have heard pyquery is good too with a jquery like interface.

Community
  • 1
  • 1
varunl
  • 19,499
  • 5
  • 29
  • 47