title: How to match regex expression with url in selenium?
body: <pre><code>public class Unsplash {
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          System.setProperty("webdriver.firefox.marionette","d:\\selenium\\gecko\\geckodriver.exe");
          WebDriver driver = new FirefoxDriver();
  
          driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);     
          driver.manage().window().maximize();
          //driver.manage().window().setPosition(new Point(1920,0));
          //driver.manage().window().setSize(new Dimension(1920/2,1080));
          driver.get("http://unsplash.com/");
          driver.findElement(By.className("_32SMR")).click();
          for(int i=0;i&lt;30;i++)
          {
              driver.findElement(By.tagName("body")).sendKeys(Keys.PAGE_DOWN);
  
          }
          //driver.getPageSource();
          Pattern p = Pattern.compile("/?photo=(.*?)");
          Matcher m = p.matcher(driver.getPageSource());
          while(m.find())
          {
  
              driver.get("https://unsplash.com"+m.group());
              System.out.println(m.group());
          }
  
          driver.quit();
      }
  
  }
  </code></pre>
  
  <p>Iam trying to extract href links from unsplash.com to automate it for downloading website the href linksformat is  href="/photos/9l_326FISzk"</p>
  
  <p>for the  code System.out.println(m.group()); Iam just getting "/photos/" as ouput .
  How can I get full href url for example "/photos/9l_326FISzk " as output</p>