mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
from __future__ import annotations (#2464)
* from __future__ import annotations
* fixup! from __future__ import annotations
* fixup! from __future__ import annotations
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
"""
|
||||
Scraping jobs given job title and location from indeed website
|
||||
"""
|
||||
from typing import Generator, Tuple
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Generator
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
@@ -9,7 +11,7 @@ from bs4 import BeautifulSoup
|
||||
url = "https://www.indeed.co.in/jobs?q=mobile+app+development&l="
|
||||
|
||||
|
||||
def fetch_jobs(location: str = "mumbai") -> Generator[Tuple[str, str], None, None]:
|
||||
def fetch_jobs(location: str = "mumbai") -> Generator[tuple[str, str], None, None]:
|
||||
soup = BeautifulSoup(requests.get(url + location).content, "html.parser")
|
||||
# This attribute finds out all the specifics listed in a job
|
||||
for job in soup.find_all("div", attrs={"data-tn-component": "organicJob"}):
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import csv
|
||||
from typing import Dict
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
def get_imdb_top_250_movies(url: str = "") -> Dict[str, float]:
|
||||
def get_imdb_top_250_movies(url: str = "") -> dict[str, float]:
|
||||
url = url or "https://www.imdb.com/chart/top/?ref_=nv_mv_250"
|
||||
soup = BeautifulSoup(requests.get(url).text, "html.parser")
|
||||
titles = soup.find_all("td", attrs="titleColumn")
|
||||
|
||||
Reference in New Issue
Block a user