title: Selenium JAVA get parameter from a URL
body: <p>I have the following URL that I need to get the 4805206 code from.</p>
  
  <pre><code> href="http://adserver.adtech.de/adlink|832|4805206|0|1686|AdId=9624985;BnId=1;itime=527032581;nodecode=yes;link=http://URL/Recruiters/Lex-Consultancy-3979.aspx"
  </code></pre>
  
  <p>I was wondering if its possible to do this and if so how?</p>
  
  <p>Heres my Java Selenium Class</p>
  
  <pre><code>    public void checkAdTechKeys(WebDriver driver) {
  
      if(driver.getCurrentUrl().equalsIgnoreCase("URL"))
      {
          HP_LeftSearchBox(driver);//enter search terms
          driver.get("URL");
          // driver.findElement(By.linkText("Read     More")).getAttribute("href").toString();
                      String url = new String(driver.findElement(By.linkText("Read More")).getAttribute("href").toString());
                  //  url = url.split("|")[2];
                   System.out.println(url);
      }else{
          setup.loadHomePage(driver);
          checkAdTechKeys(driver);
      } 
  }
  </code></pre>