title: Can ansible get a url from an anchor on a webpage?
body: <p>I want Ansible to install a <code>.deb</code> package from a url when the url changes every week (because of updates). There is an anchor to the dynamic download url on a static download page. Is there a trick to have ansible figure out the url?</p>
  
  <p>E.g. on a certain page, there is a link called <em>"Latest version"</em> as so:</p>
  
  <pre><code>&lt;a href="URL_TO_DOWNLOAD_DEB"&gt;Latest version&lt;/a&gt;.
  </code></pre>
  
  <p>Can I get ansible to get <code>URL_TO_DOWNLOAD_DEB</code>?</p>
  
  <p>Here is some made-up trick that hopefully illustrates what I mean. Obviously, this does not work.</p>
  
  <pre><code>- name: Find link to DEB package
    regex_from_url:
      url: http://some.download.page
      regex: g/&lt;a href="([^"]+)"&gt;Latest version&lt;\/a&gt;./
      register: URL_TO_DOWNLOAD_DEB
  - name: Install DEB package
    apt:
      deb: {{ URL_TO_DOWNLOAD_DEB }}
  </code></pre>