title: Web scraping with R?
body: <p>I have a dataframe which indicates, in column, an url.</p>
  <pre><code>test = data.frame (id = 1, url = &quot;https://www.georisques.gouv.fr/risques/installations/donnees/details/0030.12015&quot;)
  </code></pre>
  <p>Using this, I would like to retrieve an element in the web page. Specifically, I would like to retrieve the value of the activity state.
  <a href="https://zupimages.net/viewer.php?id=20/51/t1fx.png" rel="nofollow noreferrer">https://zupimages.net/viewer.php?id=20/51/t1fx.png</a></p>
  <p>Thanks to my research, I was able to find a code which allows to select the element thanks to its &quot;XPath&quot;.</p>
  <pre><code>library (rvest)
  
  page = read_html (&quot;https://www.georisques.gouv.fr/risques/installations/donnees/details/0030.12015&quot;)
  page%&gt;% html_nodes (xpath = '// * [@ id = &quot;detailAttributFiche&quot;] / div / p')%&gt;% html_text ()%&gt;% as.character ()
  
  character (0)
  </code></pre>
  <p>As you can see, I always have a &quot;character (0)&quot; that appears, as if it couldn't read the whole page. I suspect some JavaScript part is not linking properly ...</p>
  <p>How can I do ?
  Thank you.</p>