title: Scrape using Perl regex in R
body: <p>Using either rvest or RSelenium when you scrape the links in R, you are able to do it by defining the begining part of HTML code, e.g. a href within given node. What if I face the following link:</p>
  
  <pre><code>&lt;a href="www.website.com" data-tracking="click_body" data-tracking- 
  data='{"touch_point_button":"photo"}' data-featured-name="listing_no_promo" &gt;
  </code></pre>
  
  <p>If I would like to grab no promo links, then I would use (from XML and httr package) the following piece of code:</p>
  
  <pre><code>library(XML)
  library(httr)
  response &lt;- GET(yourLink)
  parsedoc &lt;- htmlParse(response)
  xpathSApply(parsedoc, "//a[@data-featured-tracking='listing_no_promo']", 
  xmlGetAttr, "href")
  </code></pre>
  
  <p>What should I do in case when I would like to obtain link which ends with 'photo' part of xpath:</p>
  
  <pre><code>data-tracking- data='{"touch_point_button":"photo"}'
  </code></pre>
  
  <p>not caring about promo or no promo part? My guess is that curly brackets are making here some noise.</p>