src/webscraper.py
def scrape_data (*keywords:str, number_of_items: int) -> pd.DataFrame:
    """
    This function scrapes the Ebay website and returns a dataframe of the listings. Multiple keywords
    can be passed as parameters

    Args:
        number_of_items (int): Number of items to scrape
        keywords (str): category of items

    Returns:
        data: A dataframe of all the items scraped, including their prices, links to images and urls
        
    """
    data_list= [] 
    for keyword in keywords:
        urls= get_url(keyword, number_of_items)
        for url in urls:
            page= request_page(url)
            soup= create_soup(page)
            items= find_items(soup, keyword)
            data_list.extend(items)
            # if len(data_list) >= number_of_items:
            #     break
            print ('Next page to be scraped and appended')
            time.sleep(4)
    data= create_dataframe(data_list)
    return data

    This function scrapes the Ebay website and returns a dataframe of the listings. Multiple keywords
    can be passed as parameters

    Args:
        number_of_items (int): Number of items to scrape
        keywords (str): category of items

    Returns:
        data: A dataframe of all the items scraped, including their prices, links to images and urls
        
    
This function scrapes the Ebay website and returns a dataframe of the listings. Multiple keywords
can be passed as parameters
This function scrapes the Ebay website and returns a dataframe of the listings . Multiple keywords can be passed as parameters
def scrape_data (*keywords:str, number_of_items: int) -> pd.DataFrame:
    data_list= [] 
    for keyword in keywords:
        urls= get_url(keyword, number_of_items)
        for url in urls:
            page= request_page(url)
            soup= create_soup(page)
            items= find_items(soup, keyword)
            data_list.extend(items)
            print ('Next page to be scraped and appended')
            time.sleep(4)
    data= create_dataframe(data_list)
    return data
def scrape_data ( * keywords : str , number_of_items : int ) -> pd . DataFrame : data_list = [ ] for keyword in keywords : urls = get_url ( keyword , number_of_items ) for url in urls : page = request_page ( url ) soup = create_soup ( page ) items = find_items ( soup , keyword ) data_list . extend ( items ) print ( 'Next page to be scraped and appended' ) time . sleep ( 4 ) data = create_dataframe ( data_list ) return data
This function scrapes the Ebay website and returns a dataframe of the listings.
This function scrapes the Ebay website and returns a dataframe of the listings .
"""
    This function scrapes the Ebay website and returns a dataframe of the listings. Multiple keywords
    can be passed as parameters

    Args:
        number_of_items (int): Number of items to scrape
        keywords (str): category of items

    Returns:
        data: A dataframe of all the items scraped, including their prices, links to images and urls
        
    """ # if len(data_list) >= number_of_items: #     break
A dataframe of all the items scraped, including their prices, links to images and urls
A dataframe of all the items scraped including their prices links to images and urls
data
keywords
str
category of items
category of items
number_of_items
int
Number of items to scrape
Number of items to scrape