import os
import dotenv
import httpx
import bs4

dotenv.load_dotenv()

username = os.environ.get("MASSIVE_USERNAME", "")
password = os.environ.get("MASSIVE_API_KEY", "")

host = "network.joinmassive.com"
port = 65534

proxy = f"http://{username}:{password}@{host}:{port}"
# URL for the static version of the "Quotes to Scrape" site.
url = "https://quotes.toscrape.com/"

response = httpx.get(url, proxy=proxy)
response.raise_for_status()

soup = bs4.BeautifulSoup(response.text, "html.parser")

# Print the author of each of the quotes.
for author in soup.select(".quote .author"):
    print(author.text)
