-2

I have installed bs4 and Python 3.4.4.

>>> print soup.prettify()
File "<stdin>", line 1
print soup.prettify()
         ^
Syntax Error: invalid syntax
halfer
  • 19,824
  • 17
  • 99
  • 186
Haroon
  • 59
  • 2
  • 7

1 Answers1

3

In Python 3.x, print is a function, not a statement.

So, you want to call it as print(soup.prettify()).

Rushy Panchal
  • 16,979
  • 16
  • 61
  • 94