-1
我需要從使用django框架獲取數據,並寫入數據庫。行使用javascript添加到表格中。例如:Django從數據庫的html表中獲取數據
<table id="tbl" >
<thead >
<tr>
<th>Name</th>
<th>Phone</th>
<th>Sarlay</th>
<th>P1</th>
<th>P2</th>
</tr>
</thead>
<tbody class="scrollContent">
</tbody>
</table>
<button type="button" onclick="Add_Row()" class="btn btn-primary">Add</button>
<script >
function Add_Row()
{
document.getElementById("scrolltable").insertRow(-1).innerHTML = ' <tr><td><input class="form-control" name="inp" type="text" value=""/></td><td><input class="form-control" name="inp" type="text" value=""/></td><td><input class="form-control" name="inp" type="text" value=""/></td><td><input class="form-control" name="inp" type="text" value=""/></td><td><input class="form-control" name="inp" type="text" value=""/></td></tr>';
}
</script>
誰知道如何從該表中獲取數據?
P.S.我試圖用BeautifulSoup來解決這個問題,但它並沒有幫助我。
它是現在的形式,這是一個接近的投票減輕棒。更新問題以顯示您嘗試的內容。 BeautifulSoup不會工作,因爲你似乎正在生成與JavaScript的頁面。 – e4c5
這與Django和BeautifulSoup都沒有關係 – Raptor