# BigCodeBench / 

task_id: fb8f39e3-8392-575c-9933-fb847f1f14e9
task_key: default--v0~2e1~2e0~5fhf--fb8f39e3-8392-575c-9933-fb847f1f14e9
task_revision_id: 1

{"code_prompt":"import requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\ndef task_func(url: str, csv_file_path: str) -> list:\n","complete_prompt":"import requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\n\ndef task_func(url: str, csv_file_path: str) -> list:\n    \"\"\"\n    Extracts title, date, and author information from a webpage and writes the data to a CSV file.\n\n    The function iterates through each 'div' element with a class 'container', extracting the text of 'h1', and 'span' elements with classes \n    'date' and 'author', respectively. Default values ('No Title', 'No Date', or 'No Author') are used if an element is \n    not found. The extracted data is stored in a list of tuples.\n\n    The list of tuples is then converted into a Pandas DataFrame and saved to a CSV file at the specified file path. \n    The DataFrame's columns are labeled as 'Title', 'Date', and 'Author'. The function returns the list of tuples.\n\n    Raises:\n    - RuntimeError: If the URL is incorrect or the server is down, the error message might be \"Error fetching URL: HTTP Error 404: Not Found\" \n    or \"Error fetching URL: ConnectionError\". The function begins by making an HTTP request to the specified URL. It sets a timeout of 5 seconds to avoid \n    prolonged waiting in case of unresponsive webpages. If the request encounters any exceptions such as connection errors, timeouts, or HTTP errors, a 'requests.RequestException' is raised. \n    The function raises a '' with a message that includes the details of the exception. For example,, depending on the specific issue encountered.\n    Parameters:\n\n    Parameters:\n    - url (str): The URL of the webpage to be parsed.\n    - csv_file_path (str): The path where the resulting CSV file will be saved.\n\n    Returns:\n    list: A list of tuples containing the (title, date, author) extracted from the webpage. Default placeholders \n          are used for missing information.\n\n    Requirements:\n    - requests\n    - bs4\n    - pandas\n\n    Example:\n    >>> data = task_func('https://example.com/articles', '/path/to/save/csv/file.csv')\n    >>> type(data)\n    <class 'list'>\n    >>> len(data) > 0\n    True\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Extracts title, date, and author information from a webpage and writes the data to a CSV file. The function iterates through each 'div' element with a class 'container', extracting the text of 'h1', and 'span' elements with classes 'date' and 'author', respectively. Default values ('No Title', 'No Date', or 'No Author') are used if an element is not found. The extracted data is stored in a list of tuples. The list of tuples is then converted into a Pandas DataFrame and saved to a CSV file at the specified file path. The DataFrame's columns are labeled as 'Title', 'Date', and 'Author'. The function returns the list of tuples.\nThe function should raise the exception for: RuntimeError: If the URL is incorrect or the server is down, the error message might be \"Error fetching URL: HTTP Error 404: Not Found\" or \"Error fetching URL: ConnectionError\". The function begins by making an HTTP request to the specified URL. It sets a timeout of 5 seconds to avoid prolonged waiting in case of unresponsive webpages. If the request encounters any exceptions such as connection errors, timeouts, or HTTP errors, a 'requests.RequestException' is raised. The function raises a '' with a message that includes the details of the exception. For example,, depending on the specific issue encountered.\nThe function should output with:\n    list: A list of tuples containing the (title, date, author) extracted from the webpage. Default placeholders\n    are used for missing information.\nYou should write self-contained code starting with:\n```\nimport requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\ndef task_func(url: str, csv_file_path: str) -> list:\n```","libs":"['pandas', 'bs4', 'requests']"}

Source: https://bigcode-bench.github.io/

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=fb8f39e3-8392-575c-9933-fb847f1f14e9&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
