I'm doing a basic document summary and I'm using BeautifulSoup to parse the document in VS Code.
When I run my code in Terminal, it runs with no errors. However, when I use Code Runner to get an output, it returns the error, "ImportError: No module named bs4." I thought it might be a problem with bs4, so I tried a number of variations on the import format:
from bs4 import BeautifulSoup4 as bs
import BeautifulSoup as bs
import BeautifulSoup4 as bs
I uninstalled and reinstalled bs4 with pip to both Python 2.7 and Python3.7.
This is the context of the code that I think should work.
import urllib.request
import re
scraped_data=urllib.request.urlopen('http://test.com/path.pdf')
article = scraped_data.read()
parsed_Article=bs.BeautifulSoup(article, 'lxml')
It should recognize bs4 as BeautifulSoup4 and run it as such to parse the webpage doc. Instead, it just gives the error that no module named bs4 exists. The end result of all the code will be a 7 sentence summary of the url document. I believe this is a Code Runner problem since it ran ok in Terminal. Since I need the print(summary) as an output, I'm using Code Runner. Maybe there's a different program I should be using to run the code and get the 7 sentence summary out.