I am trying to select specific elements from a particular
Here’s my code:
from bs4 import BeautifulSoup import requests CompanyNOT = "apple" url = "https://www.annualreports.com/Companies?search=" page_to_scrape = requests.get(url+CompanyNOT) soup=BeautifulSoup(page_to_scrape.content,"html.parser") urls = soup.find_all('a', href=True)
I need to extract all elements with
/Company in them, like this:
[/Company/apple-hospitality-reit-inc, /Company/apple-in, /Company/maui-land-pineapple-co-inc, /Company/pineapple-energy-inc]. How can I do this?