Install python modules?

Install python modules?

Posted by: matthewcroberts
Posted on: 2007-06-28 13:03:00

I have a python script to run that calls BeautifulSoup for web parsing. Can anyone suggest how to install BeautifulSoup so I can access it?

TIA,
matt.

Re: Install python modules?

Posted by: tvcartel
Posted on: 2009-01-14 09:53:00

somehow a friend of mine was able to get beautiful soup installed and it worked. But not correctly. When I run this command:



import urllib2
from BeautifulSoup import BeautifulSoup

page = urllib2.urlopen("http://www.icc-ccs.org/prc/piracyreport.php")



the first two lines work. But the urllib2.urlopen doesn't work. I get this error from which has to do with something on line 124 of the urllib2.py



return _opener.open(url, data, timeout)



Any help from anyone that has this working correctly would be great :)



to matthewcroberts:

I was able to install the soup from this page
http://cosl.usu.edu/projects/educommons/documentation/how-to/installation-instructions

I had to change the filepath to where i put the soup.
i.e.
/home/username/bin/python setup.py build

I put the soup file here and then unzipped it
/home/username/lib/python2.6/site-packages

I hope that helps and let me know if it works for you

Tags: python scriptparsingtia