Return the citation number.
(base_url: str, params: dict)
| 16 | |
| 17 | |
| 18 | def get_citation(base_url: str, params: dict) -> str: |
| 19 | """ |
| 20 | Return the citation number. |
| 21 | """ |
| 22 | soup = BeautifulSoup( |
| 23 | httpx.get(base_url, params=params, timeout=10).content, "html.parser" |
| 24 | ) |
| 25 | div = soup.find("div", attrs={"class": "gs_ri"}) |
| 26 | anchors = div.find("div", attrs={"class": "gs_fl"}).find_all("a") |
| 27 | return anchors[2].get_text() |
| 28 | |
| 29 | |
| 30 | if __name__ == "__main__": |
no test coverage detected