MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / horoscope

Function horoscope

web_programming/daily_horoscope.py:13–19  ·  view source on GitHub ↗
(zodiac_sign: int, day: str)

Source from the content-addressed store, hash-verified

11
12
13def horoscope(zodiac_sign: int, day: str) -> str:
14 url = (
15 "https://www.horoscope.com/us/horoscopes/general/"
16 f"horoscope-general-daily-{day}.aspx?sign={zodiac_sign}"
17 )
18 soup = BeautifulSoup(httpx.get(url, timeout=10).content, "html.parser")
19 return soup.find("div", class_="main-horoscope").p.text
20
21
22if __name__ == "__main__":

Callers 1

daily_horoscope.pyFile · 0.85

Calls 2

getMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected