我想提取
日期不是数据
来自以下给出的链接:
http://www.thehindu.com/sci-tech/science/iit-bombay-birds-eye-view-and-quantum-biology/article18191268.ece
在python 2.7中使用BeautifulSoup4。我希望输出看起来像:
April 22, 2017 18:57 IST
答案 0 :(得分:0)
这是我的解决方案。
<link href="~/Models/css/footable.bootstrap.min.css" rel="stylesheet" />
<script src="~/Models/js/footable.min.js"></script>
<script>
$(function(){
$('.table').footable({
"expandFirst": true,
"columns": [
{ "name": "id", "visible": false },
{ "name": "firstName", "title": "First Name" },
{ "name": "lastName", "title": "Last Name" },
{ "name": "jobTitle", "title": "Job Title", "breakpoints": "xs" },
{ "name": "started", "title": "Started On", "breakpoints": "xs sm" },
{ "name": "dob", "title": "Date of Birth", "breakpoints": "all" }
],
"rows": [
{ "id": 1, "firstName": "Dennise", "lastName": "Fuhrman", "jobTitle": "High School History Teacher", "started": "November 8th 2011", "dob": "July 25th 1960" },
{ "id": 2, "firstName": "Elodia", "lastName": "Weisz", "jobTitle": "Wallpaperer Helper", "started": "October 15th 2010", "dob": "March 30th 1982" },
{ "id": 3, "firstName": "Raeann", "lastName": "Haner", "jobTitle": "Internal Medicine Nurse Practitioner", "started": "November 28th 2013", "dob": "February 26th 1966" },
{ "id": 4, "firstName": "Junie", "lastName": "Landa", "jobTitle": "Offbearer", "started": "October 31st 2010", "dob": "March 29th 1966" },
{ "id": 5, "firstName": "Solomon", "lastName": "Bittinger", "jobTitle": "Roller Skater", "started": "December 29th 2011", "dob": "September 22nd 1964" },
{ "id": 6, "firstName": "Bar", "lastName": "Lewis", "jobTitle": "Clown", "started": "November 12th 2012", "dob": "August 4th 1991" },
{ "id": 7, "firstName": "Usha", "lastName": "Leak", "jobTitle": "Ships Electronic Warfare Officer", "started": "August 14th 2012", "dob": "November 20th 1979" },
{ "id": 8, "firstName": "Lorriane", "lastName": "Cooke", "jobTitle": "Technical Services Librarian", "started": "September 21st 2010", "dob": "April 7th 1969" }
]
});
});
</script>
但IMO你必须做好准备 - 在使用bs4时 - 使用它,寻找HTML选择器,搜索文档,并耐心等待。
我希望这不是你的懒惰;)