If you want to get posts from category using the slug in WordPress? Replace your category parameter with category_name.
$args = array( 'numberposts' => 10, 'category_name' => 'cat-slug' );
$posts = get_posts( $args );
foreach( $posts as $post ): setup_postdata($post);
<divs with the_title() the_excerpt() etc ></div>
<?php endforeach; ?>
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.