I've installed BeautifulSoup4 in jupyter notebook. Error comes up when trying to use "from bs4 import BeautifulSoup

Viewed 22

from selenium.webdriver import Chrome
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
import pandas as pd

raise ImportError 'You are trying to use a Python 3-specific version of Beautiful Soup under Python 2. This will not work. The final version of Beautiful Soup to support Python 2 was 4.9.3.'

ValueError: source code string cannot contain null bytes

1 Answers

Apparently you are not using the good version of Python.
Which version are you using in your NoteBook ?
You can find it in the top right corner
Version Python On VSCode

You can change it easily just by clicking on it
If it's not working, You should install BeautifulSoup with the right version of Python :
-> pip install beautifulsoup4
or maybe more :
-> pip3 install beautifulsoup4

after that relauch VSCode

I hope that I helped you :)

Related