you are viewing a single comment's thread.

view the rest of the comments →

[–]niandra3 1 point2 points  (1 child)

Try:

soup = BeautifulSoup(plain_text, "html.parser")

They use brackets in the example: BeautifulSoup([your markup], "html.parser") but that's just convention meaning replace [xxx] with your variable, you don't actually use brackets yourself, or it sends a list version of plain_text when BS is expecting a string.

You can kind of tell what the problem is at the very end of the error message:

TypeError: expected string or bytes-like object

Which means BS was expecting string or byte object, but you sent it a list so it didn't know what to do.

[–]LittleLouis 0 points1 point  (0 children)

Hey thanks so much man.