[Solved] How do i grab 80 and 443 out of tag


# If Your Looking To Parse An .html File

from bs4 import BeautifulSoup
with open('test.html') as html_file:
    soup = BeautifulSoup(html_file, 'html.parser')
    ul = soup.find('ul', {'class', 'ports'})
    a = ul.findAll('a')
    Ports=[]
    for port in a:
        Ports.append(port.string)

# If Your Looking To Parse A Website

from bs4 import BeautifulSoup
import requests
session=requests.session()
endpoint = LINK
response = session.get(endpoint)
soup = BeautifulSoup(response.text, 'html.parser')
ul = soup.find('ul', {'class', 'ports'})
a = ul.findAll('a')
Ports=[]
for port in a:
    Ports.append(port.string)

solved How do i grab 80 and 443 out of tag