
So the relevant XPath query would be something like:
//label[@for='departure']
I would also recommend using Explicit Wait in order to wait until the label will appear in DOM.
Example code:
package com.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;
public class TestClass {
@Test
public void someTest() throws Exception {
System.setProperty("webdriver.chrome.driver", "c:/apps/webdriver/chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.get("https://www.makemytrip.com/ ");
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement departure = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//label[@for='departure']")));
System.out.println(departure.getAttribute("innerText"));
driver.quit();
}
}
Demo:

More information: How to use Selenium to test web applications using AJAX technology