title: Use rvest to extract html table
body: <p>I am a new learner for R, I am interested in using rvest to extract html table and submit html forms.</p>
  
  <p>Now, I want to get some useful information from a Chinese Website.  The url is:</p>
  
  <p><a href="http://caipiao.163.com/award/cqssc/20160513.html" rel="nofollow">http://caipiao.163.com/award/cqssc/20160513.html</a></p>
  
  <p>I am using Windows 10 Professional with RStudio Version 0.99.896, I use Google Chrome as the web browser with XPATH helper addon.</p>
  
  <p>I want to extract the main html table from the Chinese site, it contains 120 groups of information about the lottery winning number.  The first one (001) is: 98446 and  the last one (120) is: 01798; I want to extract only the numbers (001) to (120) and the winning numbers: 98446 to 01798.</p>
  
  <p>I used XPATH helper and Chrome web development to get the XPATH.</p>
  
  <p>I think the XPATH for the information I want is:</p>
  
  <pre><code>//html/body/article[@class='docBody clearfix']/section[@id='mainArea']/div[@class='lottery-results']/table[@class='awardList']/*[@id="mainArea"]/div[1]/table/tbody/tr[2]/td[1]
  </code></pre>
  
  <p>But when I run the following code in RStudio, I can not get the result I want.
  The following is my code:</p>
  
  <pre><code>&gt; library(rvest)
  Loading required package: xml2
  &gt; url &lt;- "http://caipiao.163.com/award/cqssc/20160513.html"
  &gt; xp &lt;- "//html/body/article[@class='docBody clearfix']/section    [@id='mainArea']/div[@class='lottery-results']/table[@class='awardList']/*[@id='mainArea']/div[1]/table/tbody/tr[2]/td[1]"
  &gt; 
  &gt; x &lt;- read_html(url)
  &gt; y &lt;- x %&gt;% html_nodes(xpath=xp)
  &gt; y
  {xml_nodeset (0)}
  
  &gt;
  </code></pre>
  
  <p>Please take a look at my code and let me know if I made any mistakes.  You can simply ignore those unknown Chinese characters, they are not important, I just want to get the numbers.</p>
  
  <p>Thanks!
  John</p>