BeautifulSoup compatibility against trunk

Bug #1289324 reported by 王嘉楠
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Confirmed
Low
Unassigned

Bug Description

Hi, it's my first time to report bug.
Sorry if i'm wrong.

from http://www.crummy.com/software/BeautifulSoup/ ,
It seems that beautifulsoup dev team modify the namespace and API of module ,
so it should be like that "from bs4 import BeautifulSoup".

However, in lxml/html/soupparser.py , there is "from BeautifulSoup import XXX",
so when I import the package in my script, it raised ImportError: No module named BeautifulSoup

Regards,
Lan

Development Environment:
mac osx 10.9.1
Python : (2, 7, 5)
lxml : (3, 3, 3, 0)
libxml used : (2, 9, 0)
libxml complied : (2, 9, 0)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)

Revision history for this message
scoder (scoder) wrote :

Yes, there is a new(er) version 4.x of BS that should get supported, in addition to the current BS 3.x support. If it can be done with a conditional import (prefering the newer version), that would be nice. I'd accept a pull request that implements that. Note that the tests in test_elementsoup.py should then also test both versions if both are installed. That might be the tricky part of it.

Changed in lxml:
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.