Indicates an error in the BeautifulSoup code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When I do this:
from bs4 import BeautifulSoup
import urllib.request
req = urllib.
# html = req.read()
print(req)
An error comes out:
Traceback (most recent call last):
File "C:/pyton/
from bs4 import BeautifulSoup
File "C:\pyton\
from .builder import builder_registry, ParserRejectedM
File "C:\pyton\
from bs4.element import (
File "C:\pyton\
from bs4.formatter import (
File "C:\pyton\
from bs4.dammit import EntitySubstitution
File "C:\pyton\
import logging
File "C:\Python37\
from string import Template
File "C:\pyton\
print(verse1)
^
SyntaxError: EOF while scanning triple-quoted string literal
Changed in beautifulsoup: | |
status: | New → Invalid |
It looks like you created a file called "string.py" in your root Python directory. That's the file with the syntax error in it. "string" is the name of a standard library in Python. When the "logging" library tries to import that library, it's getting your "string.py" instead.
Rename string.py to something else and the problem should go away.