(location: str = "mumbai")
| 21 | |
| 22 | |
| 23 | def fetch_jobs(location: str = "mumbai") -> Generator[tuple[str, str]]: |
| 24 | soup = BeautifulSoup(httpx.get(url + location, timeout=10).content, "html.parser") |
| 25 | # This attribute finds out all the specifics listed in a job |
| 26 | for job in soup.find_all("div", attrs={"data-tn-component": "organicJob"}): |
| 27 | job_title = job.find("a", attrs={"data-tn-element": "jobTitle"}).text.strip() |
| 28 | company_name = job.find("span", {"class": "company"}).text.strip() |
| 29 | yield job_title, company_name |
| 30 | |
| 31 | |
| 32 | if __name__ == "__main__": |
no test coverage detected