using beautifulsoup

85 views
Skip to first unread message

Saleem Dar

unread,
Dec 28, 2021, 7:47:12 AM12/28/21
to beautifulsoup
hello;

i am taking a course on python and as part of that course, i have to use beautiful soup. the course  provides some code as sample / for practice. yet when i try to run the code i keep getting error messages
can anyone guide me?
i am attaching screenshots for reviewch12_urllinks_code3.pngch12_urllinks_py_error.pngpy_versions.png
if i can get the sample program to work, i can figure out how to adapt it to other tasks.

leonardr

unread,
Dec 28, 2021, 7:54:22 AM12/28/21
to beautifulsoup
Hello,

The sample code you got includes a version of Beautiful Soup from 2018 or earlier -- probably 4.7.0. That version won't work on Python 3.8. See bug #1778909  for details.

If you can replace it with a more recent version of Beautiful Soup, you'll solve the problem.

Leonard

Saleem Dar

unread,
Dec 28, 2021, 9:10:50 AM12/28/21
to beautifulsoup
thank you for your reply.

i have latest version og beautiful soup i think; plz see attached pip list 
pip list part.png

i tried reinstalling beautiful soup but it said already installed so i could not arrange that 
bs reinstall try.png

leonardr

unread,
Dec 28, 2021, 10:34:09 AM12/28/21
to beautifulsoup
You do have the latest version of Beautiful Soup installed, but the older version included with the PY4E package is overriding it.

On your computer, the older version is being kept in C:\Users\salee\Desktop\p100\python_projects\py4e_code3\bs4. If you move that directory out of the way, the sample code should start using the later version installed system-wide.

I've filed an issue against PY4E mentioning this problem and suggested that they upgrade the version of Beautiful Soup included with PY3E.

Leonard

Saleem Dar

unread,
Dec 28, 2021, 10:16:16 PM12/28/21
to beautifulsoup
thank you for your reply; removing the bs4 directory does seem to have solved the problem
saleem

Reply all
Reply to author
Forward
0 new messages