How can i get the first link from row 2 with simple html dom php ?

```
    <div class"content">
//row 1
 <div class="row">
       <h2 class="headline">Movies</h2>
          <a href="http://test.com/everest-2015">
          <a href="http://test.com/everest-fly-2015">
    </div>

//row 2
   <div class="row">
       <h2 class="headline">TvShows</h2>
          <a href="http://test.com/everest-2015">
          <a href="http://test.com/everest-fly-2015">
    </div>

 </div>

```

some times i get one row sometimes i have 2 rows, so i want a way to get by `<h2>` `innertext` **TvShows**

```
$title_show = "the flash";
     $html = file_get_html('https://tainies.online/search?q='.$title_show.'');

    $elements = $html->find("figcaption .$title_show. a");

            if(!is_null($elements)){

                foreach($elements as $element){
                //first tvshow search result
                     if ($tmp++ < 1) {
                    $query = parse_url($element, PHP_URL_QUERY);
                    parse_str($query,$op);
                    $link = base64_decode($op["url"]);  
                     $url22 =  $element->href;
        if(strpos($element->href, $title_show) !== false) {
                    $url22_season = $url22;
                        }
                     }
                    }
                }
            echo $url22."</br>";

```

this is the page <https://tainies.online/search?q=the+flash>
that im trying to get **the flash 2014** url , as you can se the result search give movies(ΤΑΙΝΙΕΣ) with that name and tv shows(ΣΕΙΡΕΣ)

my code give me the url for movie (ΤΑΙΝΙΕΣ)-justice-league-**the-flash**point-paradox and i need the code to give the url off the first tvshow from tv shows(ΣΕΙΡΕΣ)