first-web-scraper icon indicating copy to clipboard operation
first-web-scraper copied to clipboard

soup syntax error

Open abuchan82 opened this issue 7 years ago • 2 comments

syntax error Guys,

Whenever I use beautiful soup I always get this syntax error, I am a very new user of python and I just don't understand this error.

abuchan82 avatar Nov 02 '18 11:11 abuchan82

You're using Python 3, and that's a Python 2 program. Use parenthesis: print(soup.prettify())

stucka avatar Nov 02 '18 17:11 stucka

pip install bs4

`import requests from bs4 import BeautifulSoup

URL = 'https://ww.cityfm.com/ reps = request.get(url) soup = BeautifulSoup(resp.text, 'lxml') print(soup.prettify())

Hyperx837 avatar Jul 04 '20 15:07 Hyperx837