This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re as regex | |
def get_episodes_links(link: str, driver_service) -> List[str]: | |
"""Retrieve links to episodes, from series' season main page. | |
Args: | |
link (str): link to season main page. | |
driver_service (Service): a Chrome web driver. | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data manipulation | |
import pandas as pd | |
import re as regex | |
# Scraping | |
import requests | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.chrome.service import Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.chrome.service import Service | |
from webdriver_manager.chrome import ChromeDriverManager | |
def make_soup_with_selenium(url: str, driver_service: Service) -> BeautifulSoup: | |
"""Return an HTML body from an URL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import time | |
def timing(f: Callable) -> None: | |
"""Times a function runtime in minutes. | |
Args: | |
f (callable): a function/method. | |
""" | |
def wrap(*args, **kw): | |
ts = time() |
NewerOlder