How to get taxonomy by URL alias? I have a grade vocabulary with a 6. Class taxonomy term. The taxonomy page have an URL like 
www.example.com/foo/6-class/bar and I can't find the taxonomy with the following code.

$grade = arg(2);
$term = taxonomy_get_term_by_name($grade)


It works when I use a string (e.g. 6. Class), but not with arg(2). How can I get the correct taxonomy with this URL alias? Problem might be, that it is a exposed filter and no contextual filter. But I can not change this fact.

Neither I can get the source path with the following code. 

drupal_lookup_path('source', $_GET['q']);
drupal_lookup_path('alias', current_path());
I know this is a pretty old question but seems unanswered yet.
This Drupal 7 snippet will help you to load a taxonomy term but you need to know the name of the vocabulary it belongs to, lets say it is 'position'.
Ex. www.example.com/foo/6-class/bar

$term_path=drupal_get_normal_path('position/'.arg(1));
$tid = basename($term_url);
$term = taxonomy_term_load($tid);


If you know your url is an alias to your taxonomy term, just use

$term_path=drupal_get_normal_path(current_path());
$tid = basename($term_url);
$term = taxonomy_term_load($tid);


The drupal_lookup_path with source and uri approach did not work for you because probably that path is not an alias, or at least not for your taxonomy.

Hope this helps someone.