Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from selenium.webdriver.chrome.options import Options
- from bs4 import BeautifulSoup
- import time
- # Configure Selenium to run in headless mode
- chrome_options = Options()
- chrome_options.add_argument("--headless")
- # Set up Selenium WebDriver with the configured options
- driver = webdriver.Chrome(options=chrome_options)
- url = "https://adviserinfo.sec.gov/individual/summary/1973578"
- # Open the URL using Selenium
- driver.get(url)
- time.sleep(5)
- # Get the page source after dynamic content has loaded
- page_source = driver.page_source
- # Create a BeautifulSoup object to parse the HTML content
- soup = BeautifulSoup(page_source, "html.parser")
- # Find the span element containing the data
- span_element = soup.find("span", class_="text-lg sm:text-sm font-semibold")
- # Extract the data
- data = span_element.text.strip() if span_element else None
- print(data)
- # Close the browser
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement