Aug-17-2020, 03:35 AM
This code gets me the first link:
import requests from bs4 import BeautifulSoup # Get info from main site url = 'https://mattrode.com/blog/robinhood-collections-list/' headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36'} response = requests.get(url, headers=headers) soup = BeautifulSoup(response.content, 'lxml') ol_tag = soup.find('ol') li_tag = ol_tag.find('li') link = li_tag.a.get('href') print(link)How do I go about going into the link to extract the stock ticker symbol?