title: how to preserve links when scraping a table with beautiful soup and pandas
body: <p>Scraping a web to get a table, using <code>Beautiful soup</code> and <code>Pandas</code>. One of the columns got some urls. When I pass html to pandas, <code>href</code> are lost.</p>
  
  <p>is there any way of preserving the url link just for that column?</p>
  
  <p>Example data (edited for better suit ral case):</p>
  
  <pre><code>  &lt;html&gt;
          &lt;body&gt;
            &lt;table&gt;
                &lt;tr&gt;
                 &lt;td&gt;customer&lt;/td&gt;
                 &lt;td&gt;country&lt;/td&gt;
                 &lt;td&gt;area&lt;/td&gt;
                 &lt;td&gt;website link&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;IBM&lt;/td&gt;
                 &lt;td&gt;USA&lt;/td&gt;
                 &lt;td&gt;EMEA&lt;/td&gt;
                 &lt;td&gt;&lt;a href="http://www.ibm.com"&gt;IBM site&lt;/a&gt;&lt;/td&gt;
              &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;CISCO&lt;/td&gt;
              &lt;td&gt;USA&lt;/td&gt;
              &lt;td&gt;EMEA&lt;/td&gt;
              &lt;td&gt;&lt;a href="http://www.cisco.com"&gt;cisco site&lt;/a&gt;&lt;/td&gt;
           &lt;/tr&gt;
             &lt;tr&gt;
              &lt;td&gt;unknown company&lt;/td&gt;
              &lt;td&gt;USA&lt;/td&gt;
              &lt;td&gt;EMEA&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
           &lt;/tr&gt;
         &lt;/table&gt;
       &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>
  
  <p>My python code:</p>
  
  <pre><code>    file = open(url,"r")
  
      soup = BeautifulSoup(file, 'lxml')
  
      parsed_table = soup.find_all('table')[1] 
  
      df = pd.read_html(str(parsed_table),encoding='utf-8')[0]
  
   df
  </code></pre>
  
  <p>Output (exported to CSV):</p>
  
  <pre><code>customer;country;area;website
  IBM;USA;EMEA;IBM site
  CISCO;USA;EMEA;cisco site
  unknown company;USA;EMEA;
  </code></pre>
  
  <p>df output is ok but the link is lost. I need to preserve the link. The URL at least.</p>
  
  <p>any hint?</p>