{"id":24360418,"url":"https://github.com/dms-codes/scrape_directory_itb","last_synced_at":"2025-12-28T06:28:09.749Z","repository":{"id":199401782,"uuid":"702801967","full_name":"dms-codes/scrape_directory_itb","owner":"dms-codes","description":"ITB Directory Scraper This Python script scrapes information from the Institut Teknologi Bandung (ITB) directory and saves it to a CSV file. It uses the BeautifulSoup library to parse the HTML content of the directory pages.","archived":false,"fork":false,"pushed_at":"2023-10-10T03:38:46.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T21:20:05.222Z","etag":null,"topics":["beautifulsoup4","csv","python","requests","scrapping-python","webscrapping"],"latest_commit_sha":null,"homepage":"https://github.com/dms-codes/scrape_directory_itb","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dms-codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-10T03:37:35.000Z","updated_at":"2023-10-10T03:39:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab8663f2-ce00-49c6-b63b-53e2208288ef","html_url":"https://github.com/dms-codes/scrape_directory_itb","commit_stats":null,"previous_names":["dms-codes/scrape_directory_itb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fscrape_directory_itb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fscrape_directory_itb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fscrape_directory_itb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fscrape_directory_itb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dms-codes","download_url":"https://codeload.github.com/dms-codes/scrape_directory_itb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243182889,"owners_count":20249708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beautifulsoup4","csv","python","requests","scrapping-python","webscrapping"],"created_at":"2025-01-18T21:19:45.015Z","updated_at":"2025-12-28T06:28:09.698Z","avatar_url":"https://github.com/dms-codes.png","language":"Python","readme":"# ITB Directory Scraper\n\nThis Python script scrapes information from the [Institut Teknologi Bandung (ITB)](https://www.itb.ac.id) directory and saves it to a CSV file. It uses the BeautifulSoup library to parse the HTML content of the directory pages.\n\n## Prerequisites\n\nBefore running the script, make sure you have the following libraries installed:\n\n- requests\n- beautifulsoup4\n- csv\n\nYou can install them using pip:\n\n```bash\npip install requests beautifulsoup4\n```\n\n## Usage\n\n1. Set the following constants at the beginning of the script to configure your scraping session:\n\n    - `BASE_URL`: The base URL of the ITB directory.\n    - `TIMEOUT`: The timeout for making HTTP requests.\n    - `HEADERS`: User-Agent headers for the HTTP requests.\n\n2. Run the script by executing the following command:\n\n    ```bash\n    python itb_directory_scraper.py\n    ```\n\nThe script will scrape data from the ITB directory for each letter of the alphabet and save it to a CSV file named `data_directory_itb.csv`. The CSV file will contain the following columns:\n\n- Nama (Name)\n- URL\n- Alamat (Address)\n- Kode Pos (Postal Code)\n- Telepon (Phone Number)\n- Fax\n- Email\n\n## Functions\n\n- `extract_text(element)`: Extracts and cleans text from an HTML element.\n\n- `extract_url(element)`: Extracts the URL from an HTML element.\n\n- `extract_info(section)`: Extracts education, research, publication, and books information from an HTML section.\n\n- `extract_address(section)`: Extracts and parses the address information from an HTML section.\n\n- `write_csv(filename, data)`: Writes data to a CSV file with the specified filename.\n\n- `main()`: The main function that orchestrates the scraping process.\n\n## License\n\nThis script is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdms-codes%2Fscrape_directory_itb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdms-codes%2Fscrape_directory_itb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdms-codes%2Fscrape_directory_itb/lists"}