0

I am wondering how to fix this error I am trying to get stuff from the website

t pyttsx3
import speech_recognition as sr
import speech_recognition
from bs4 import BeautifulSoup


r = sr.Recognizer()


def speak_text(command):
    engine = pyttsx3.init()
    engine.say(command)
    engine.runAndWait()


source2: speech_recognition.Microphone
with sr.Microphone() as source2:
    r.adjust_for_ambient_noise(source2, duration=0.2)
    print("Listening...")
    audio2 = r.listen(source2)
    assert isinstance(audio2, object)
    my_text = r.recognize_google(audio2)
    print("Recognizing...")
if my_text == "test":
    print("SECRET")
else:
soup = BeautifulSoup("google.com")
for link in soup.find_all("a"):
print(link.get("href"))

This is the error I get...

GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system (" HTML. parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. The code that caused this warning is on line 31 of the file PycharmProjects/pythonProject1/main.py. To get rid of this warning, pass the additional argument 'features=" HTML. parser"' to the BeautifulSoup constructor

thanks.

Barmar
  • 741,623
  • 53
  • 500
  • 612
Blobby YT
  • 11
  • 1

1 Answers1

0

Error message says it all. Replace

soup = BeautifulSoup("google.com")

with

soup = BeautifulSoup("google.com", features="html.parserr")
OwnageIsMagic
  • 1,949
  • 1
  • 16
  • 31