summaryrefslogtreecommitdiff
path: root/bs4/diagnose.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2023-02-15 21:35:24 -0500
committerLeonard Richardson <leonardr@segfault.org>2023-02-15 21:35:24 -0500
commit021d43058412aa84777bc0383fe997e81b06363f (patch)
tree792fc50e9e7faaeb3fa8052e517e5ab51f571e57 /bs4/diagnose.py
parente0bbee776ca241d908af36e4e5ce0d0b1bedceaf (diff)
Removed some error checking code from diagnose(), which is redundant with
similar (but more Pythonic) code in the BeautifulSoup constructor. [bug=2007344]
Diffstat (limited to 'bs4/diagnose.py')
-rw-r--r--bs4/diagnose.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/bs4/diagnose.py b/bs4/diagnose.py
index 3bf583f..e079772 100644
--- a/bs4/diagnose.py
+++ b/bs4/diagnose.py
@@ -59,21 +59,6 @@ def diagnose(data):
if hasattr(data, 'read'):
data = data.read()
- elif data.startswith("http:") or data.startswith("https:"):
- print(('"%s" looks like a URL. Beautiful Soup is not an HTTP client.' % data))
- print("You need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup.")
- return
- else:
- try:
- if os.path.exists(data):
- print(('"%s" looks like a filename. Reading data from the file.' % data))
- with open(data) as fp:
- data = fp.read()
- except ValueError:
- # This can happen on some platforms when the 'filename' is
- # too long. Assume it's data and not a filename.
- pass
- print("")
for parser in basic_parsers:
print(("Trying to parse your markup with %s" % parser))