I am using BeautifulSoup for scraping the Nasdaq site. Using the code below,
from urllib import request
from bs4 import BeautifulSoup
import requests
import urllib.request, urllib.error, urllib.parse
import xml.etree.ElementTree as ET
import ssl
ctx = ssl.create_default_context()
ctx.check_hostname= False
ctx.verify_mode = ssl.CERT_NONE
sym = input('Enter Ticker: ').upper()
ur = 'https://www.nasdaq.com/feed/rssoutbound?symbol='
url = ur+sym
html = urllib.request.urlopen(url, context=ctx).read()
soup = BeautifulSoup(html, 'html.parser')
print(soup)
The problem is the the moment I run this code, it hangs. Like it doesn't do anything just stops there. I was entering the ticker as msft for microsoft. I need to know if my code has any error. And if not, then why the code is not running.