Initialise datasets and functions to retrieve data, and execute each for a given link. Args: link (str): Link to be interogated. display_status (bool, optional): Whether to print connection attempts to terminal.
(client: httpx.Client, link: str, *, display_status: bool = False)
| 33 | |
| 34 | |
| 35 | def execute_all(client: httpx.Client, link: str, *, display_status: bool = False) -> None: |
| 36 | """Initialise datasets and functions to retrieve data, and execute |
| 37 | each for a given link. |
| 38 | |
| 39 | Args: |
| 40 | link (str): Link to be interogated. |
| 41 | display_status (bool, optional): Whether to print connection |
| 42 | attempts to terminal. |
| 43 | """ |
| 44 | |
| 45 | resp = client.get(url=link) |
| 46 | soup = BeautifulSoup(resp.text, 'html.parser') |
| 47 | validation_functions = [ |
| 48 | get_robots_txt, get_dot_git, get_dot_svn, get_dot_git, get_intel, get_dot_htaccess, get_bitcoin_address |
| 49 | ] |
| 50 | for validate_func in validation_functions: |
| 51 | try: |
| 52 | validate_func(client, link, resp) |
| 53 | except Exception as e: |
| 54 | logging.debug(e) |
| 55 | cprint('Error', 'red') |
| 56 | |
| 57 | display_webpage_description(soup) |
| 58 | # display_headers(response) |
| 59 | |
| 60 | |
| 61 | def display_headers(response): |
no test coverage detected