My BOT isn't working.
ChristianThone

#ERROR 1:#
I am trying to create a bot that finds stuff on google based off of user input.

Here is my whole source_code:

The error that is brought up is:

Can someone tell me why I get this error?

#ERROR 2:#
Now even when I put the code into another project so I can try to fix it, It comes up with a new error.

That is the output it pops up above the 'Google: ' search input.

Then when I search something, it comes up with

Apparently because bs4 can't be imported or something, someone help!!!!

You are viewing a single comment. View All
Geocube101

I don't know why it's happening, but your variable title has a value of None.

ChristianThone

@Geocube101 But, how I defined the variable, and everything is under neath where I defined soup which is: soup = Beautifulsoup(req.text, "lxml")

TheDrone7

@ChristianThone for some reason the variable soup itself is of NoneType.
Try referring to the docs or doing more research, you should also try using print statements and doing it locally to see if it's only happening on repl.it

ChristianThone

@TheDrone7 I am slao Trying to make it so that the Google Summary is below the link.

TheDrone7

@ChristianThone it might be due to something like Google not sending back those details, try to write the response into a file, go through it to see what's being sent, also you can add checks to see if it is not None so you don't get the error. This is a normal problem with APIs, they might not return same fields for all queries.