I am trying to figure out how to scrape all 'symbol' elemnets from the URL below. I would like to put all symbol items into a list.
I want to get this: lst = ['NRGU', 'CHIE' .... 'PSCE', 'FXN']
I tested this concept, but it gave me a lot more than I want...I don't know how to distill it down to just the 'symbol' items.
# Print All TR & TD ELements in Web Page
from bs4 import BeautifulSoup
import requests
import pandas as pd
import csv
url = "https://etfdb.com/screener/#page=1&tab=returns&sort_by=one_week_return&sort_direction=desc&asset_class=equity&one_week_return_start=2&one_month_return_start=5&ytd_start=20&fifty_two_week_start=30"
page = requests.get(url)
pagetext = page.text
print(pagetext)
soup = BeautifulSoup(pagetext, 'html.parser')
for row in soup.find_all('tr'):
for col in row.find_all('td'):
info1 = row.text
print(info1)
info2 = col.text
print(info2)
Any thoughts on how to do this?