palewire / first-web-scraper

A step-by-step guide to writing a web scraper with Python
https://palewi.re/docs/first-web-scraper/
GNU General Public License v3.0
203 stars 165 forks source link

soup syntax error #16

Open abuchan82 opened 5 years ago

abuchan82 commented 5 years ago

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.

stucka commented 5 years ago

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

Hyperx837 commented 3 years ago

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())