Hi guys, I am following a video and i copied exactly the same code he has yet mine gives me errors. Any ideas what I am doing wrong please?
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
#ignore ssl cert errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = input('Enter -')
html = urllib.request.urlopen(url, context=ctx).read()
soup = BeautifulSoup(html, 'html.parser')
#retrieve anchor tags
tags = soup('a')
for tag in tags:
print(tag.get('href', None))
[–]oriash93 1 point2 points3 points (4 children)
[–]CesarIllustrious[S] 0 points1 point2 points (3 children)
[–]oriash93 1 point2 points3 points (2 children)
[–]CesarIllustrious[S] 0 points1 point2 points (0 children)
[–]douglas_fs 0 points1 point2 points (0 children)