def main_scraper(
    movie_name: str,
    webdriver_engine: str = "edge",
    generate_csv: bool = False,
    multithreading: bool = False,
    max_workers: int = 0,
    reviews_folder: str = "movie_reviews",
):
    """
    The main helper function to scrape data.

    Args:
        movie_name (str): The name of the movie along with the year
        webdriver_engine (str, optional): The webdriver engine to use. Defaults to "edge".
        generate_csv (bool, optional): whether to save the dataframe files. Defaults to False.
        multiprocessing (bool, optional): whether to use multithreading
        max_workers (int, optional): number of workers for multithreading application
    Returns:
        reviews_date (List): list of dates of each review
        reviews_title (List): list of title of each review
        reviews_comment (List): list of comment of each review
        reviews_rating (List):  list of ratings of each review
        reviews_link (List):  list of links of each review

    """
    if multithreading:
        assert max_workers > 0, (
            "If you are using multithreading, then max_workers should be greater than 1"
        )

    ia = imdb.Cinemagoer()
    movies = ia.search_movie(movie_name)
    movie_name = movies[0].data["title"] + " " + str(movies[0].data["year"])

    assert movie_name != "", "Please check the movie name that you passed"
    print(
        f"Scraping movie reviews for {movie_name}. If you think it is not the right one, the best practice is to pass the movie name and year"
    )
    movie_id = movies[0].movieID
    movie_link = f"https://www.imdb.com/title/tt{movie_id}/reviews/?ref_=tt_ql_2"
    if webdriver_engine == "edge":
        driver = webdriver.Edge(service=Service(EdgeChromiumDriverManager().install()))
    elif webdriver_engine == "google":
        driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
    elif webdriver_engine == "firefox":
        driver = webdriver.Firefox(service=Service(GeckoDriverManager().install()))

    driver.get(movie_link)
    driver.maximize_window()

    driver.execute_script("return document.body.scrollHeight")
    num_reviews = driver.find_element(
        By.XPATH, '//*[@id="main"]/section/div[2]/div[1]/div/span'
    ).text
    print(f"Total number of reviews are: {num_reviews}")
    while True:
        driver.execute_script("window.scrollTo(0, document.body.scrollHeight-250);")
        try:
            load_button = WebDriverWait(driver, 5).until(
                EC.element_to_be_clickable((By.CLASS_NAME, "ipl-load-more__button"))
            )
            load_button.click()
        except Exception:
            print("Load more operation complete")
            break

    driver.execute_script("window.scrollTo(0, 100);")

    rev_containers = driver.find_elements(By.CLASS_NAME, "review-container")
    muted_text = driver.find_elements(By.CLASS_NAME, "text-muted")
    muted_text = [process_muted_text(mtext.text) for mtext in muted_text]
    assert len(rev_containers) == len(muted_text), "Same length"

    reviews_date = []
    reviews_comment = []
    reviews_rating = []
    reviews_title = []
    reviews_link = []
    reviews_found_helpful = []
    reviews_total_votes = []
    reviews_if_spoiler = []
    if multithreading:
        with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
            results = executor.map(scrape_data, rev_containers)

        for res in results:
            date, contents, rating, title, link, found_helpful, total, spoiler = res
            reviews_date.append(date)

            reviews_comment.append(contents)
            reviews_rating.append(rating)
            reviews_title.append(title)
            reviews_link.append(link)
            reviews_found_helpful.append(found_helpful)
            reviews_total_votes.append(total)
            reviews_if_spoiler.append(spoiler)
    else:
        for idx, rev in enumerate(rev_containers):
            date, contents, rating, title, link, spoiler = scrape_data(rev)
            found_helpful, total = muted_text[idx]
            reviews_date.append(date)
            # time.sleep(0.2)
            reviews_comment.append(contents)
            reviews_rating.append(float(rating))
            reviews_title.append(title)
            reviews_link.append(link)
            reviews_found_helpful.append(float(found_helpful))
            reviews_total_votes.append(float(total))
            reviews_if_spoiler.append(spoiler)

    print(f"Number of reviews scraped: {len(reviews_date)}")
    if generate_csv:
        os.makedirs(reviews_folder, exist_ok=True)
        df = pd.DataFrame(
            columns=[
                "review_date",
                "review_title",
                "review_comment",
                "review_rating",
                "review_helpful",
                "review_total_votes",
                "reviews_if_spoiler",
            ]
        )

        df["review_date"] = reviews_date
        df["review_title"] = reviews_title
        df["review_comment"] = reviews_comment
        df["review_rating"] = reviews_rating
        df["review_link"] = reviews_link
        df["review_helpful"] = reviews_found_helpful
        df["review_total_votes"] = reviews_total_votes
        df["reviews_if_spoiler"] = reviews_if_spoiler
        df.to_csv(f"{reviews_folder}/{movie_name}.csv", index=False)

    return (
        reviews_date,
        reviews_title,
        reviews_comment,
        reviews_rating,
        reviews_link,
        reviews_found_helpful,
        reviews_total_votes,
        reviews_if_spoiler,
    )

    The main helper function to scrape data.

    Args:
        movie_name (str): The name of the movie along with the year
        webdriver_engine (str, optional): The webdriver engine to use. Defaults to "edge".
        generate_csv (bool, optional): whether to save the dataframe files. Defaults to False.
        multiprocessing (bool, optional): whether to use multithreading
        max_workers (int, optional): number of workers for multithreading application
    Returns:
        reviews_date (List): list of dates of each review
        reviews_title (List): list of title of each review
        reviews_comment (List): list of comment of each review
        reviews_rating (List):  list of ratings of each review
        reviews_link (List):  list of links of each review

    
llama-index-integrations/readers/llama-index-readers-imdb-review/llama_index/readers/imdb_review/scraper.py