Pull Menu Items Into an HTML element

assuming you are adding this into a page template:

$menu_list = wp_get_nav_menu_items( 'All Pages' );

if( $menu_list ) foreach( $menu_list as $menu_item ) {
    if( $menu_item->menu_item_parent == 0 ) {
        echo '<div><a href="' . $menu_item->url . '">' . $menu_item->title . '</a></div>';
    }
}

the above shows only top menu items with their links, no dropdowns.

replace ‘All Pages’ with the name of your menu.
based on https://developer.wordpress.org/reference/functions/wp_get_nav_menu_items/: