Вот несколько способов найти онлайн-программы мини-MBA, а также примеры кода на Python:
Метод 1: парсинг веб-страниц с использованием BeautifulSoup и запросов
import requests
from bs4 import BeautifulSoup
url = "https://example.com/mini-mba-programs"
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
# Extract relevant information from the webpage
program_titles = soup.find_all("h2", class_="program-title")
program_links = [link.get("href") for link in soup.find_all("a", class_="program-link")]
# Print the program titles and links
for title, link in zip(program_titles, program_links):
print(title.text)
print(link)
Метод 2: интеграция API
import requests
url = "https://api.example.com/mini-mba-programs"
response = requests.get(url)
data = response.json()
# Extract relevant information from the API response
programs = data["programs"]
for program in programs:
print(program["title"])
print(program["link"])
Метод 3: данные из файла CSV или Excel
import pandas as pd
file_path = "mini_mba_programs.csv"
df = pd.read_csv(file_path)
# Extract relevant information from the dataframe
program_titles = df["Title"]
program_links = df["Link"]
# Print the program titles and links
for title, link in zip(program_titles, program_links):
print(title)
print(link)