Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check my BeautifulSoup version and revert it to an older version?

I am using beautifulsoup, and I am getting some htmlparser errors with start tags etc.

I read on crummy's site that one suggestion is to go back to an older version (3.08).

I am using Ubuntu, where I did:

sudo apt-get install python-beautifulsoup

to install it.

  1. how can I check what version I have now?
  2. how can I force a specific version using apt-get? (and how to uninstall what I have now)

thanks (i'm newish to ubuntu)

latest version of ubuntu 10.04

like image 555
Blankman Avatar asked Aug 09 '10 00:08

Blankman


2 Answers

In Beautiful Soup 4 its like this:

>>> import bs4
>>> bs4.__version__
'4.4.1'
like image 113
Alan Viars Avatar answered Sep 22 '22 21:09

Alan Viars


i run in the same problem on mac osx 10.5 and i removed the current version of beautiful soup with

sudo apt-get remove python-beautifulsoup

then i installed 3.0.7 from this address and all is now working fine.

To know the current version of you module:

import BeautifulSoup
print(BeautifulSoup.__version__)
like image 37
Mermoz Avatar answered Sep 22 '22 21:09

Mermoz