Initial commit: MSH System\n\n- msh_single_uniapp: Vue 2 + UniApp 前端(微信小程序/H5/App/支付宝小程序)\n- msh_crmeb_22: Spring Boot 2.2 后端(C端API/管理端/业务逻辑)\n- models-integration: AI服务集成(Coze/KieAI/腾讯ASR)\n- docs: 产品文档与设计稿
This commit is contained in:
26
msh_crmeb_22/scraper/analyze_category.py
Normal file
26
msh_crmeb_22/scraper/analyze_category.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
|
||||
url = 'http://www.ishen365.com/index.php/article/cereal'
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
|
||||
}
|
||||
|
||||
try:
|
||||
print(f"Fetching {url}...")
|
||||
response = requests.get(url, headers=headers, timeout=10)
|
||||
response.encoding = 'utf-8'
|
||||
print(f"Status Code: {response.status_code}")
|
||||
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
|
||||
# Save the HTML
|
||||
output_path = os.path.join(os.path.dirname(__file__), 'category_content.html')
|
||||
with open(output_path, 'w', encoding='utf-8') as f:
|
||||
f.write(soup.prettify())
|
||||
|
||||
print(f"Saved HTML to {output_path}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
35
msh_crmeb_22/scraper/analyze_detail.py
Normal file
35
msh_crmeb_22/scraper/analyze_detail.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Constructing the URL based on the relative link found
|
||||
url = 'http://www.ishen365.com/index.php/article/29/show/36'
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
|
||||
}
|
||||
|
||||
log_file = os.path.join(os.path.dirname(__file__), 'debug.log')
|
||||
|
||||
def log(msg):
|
||||
with open(log_file, 'a') as f:
|
||||
f.write(msg + '\n')
|
||||
print(msg)
|
||||
|
||||
try:
|
||||
log(f"Fetching {url}...")
|
||||
response = requests.get(url, headers=headers, timeout=10)
|
||||
response.encoding = 'utf-8'
|
||||
log(f"Status Code: {response.status_code}")
|
||||
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
|
||||
# Save the HTML
|
||||
output_path = os.path.join(os.path.dirname(__file__), 'detail_content.html')
|
||||
with open(output_path, 'w', encoding='utf-8') as f:
|
||||
f.write(soup.prettify())
|
||||
|
||||
log(f"Saved HTML to {output_path}")
|
||||
|
||||
except Exception as e:
|
||||
log(f"Error: {e}")
|
||||
16
msh_crmeb_22/scraper/analyze_recipe_detail.py
Normal file
16
msh_crmeb_22/scraper/analyze_recipe_detail.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
url = "http://www.ishen365.com/index.php/article/18/show/28" # 黑木耳炒山药
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
||||
}
|
||||
|
||||
try:
|
||||
response = requests.get(url, headers=headers)
|
||||
response.encoding = 'utf-8'
|
||||
with open("scraper/source_recipe_detail.html", "w", encoding="utf-8") as f:
|
||||
f.write(response.text)
|
||||
print("Saved recipe detail to scraper/source_recipe_detail.html")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
26
msh_crmeb_22/scraper/analyze_site.py
Normal file
26
msh_crmeb_22/scraper/analyze_site.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
|
||||
url = 'http://www.ishen365.com/index.php/swcfb'
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
|
||||
}
|
||||
|
||||
try:
|
||||
print(f"Fetching {url}...")
|
||||
response = requests.get(url, headers=headers, timeout=10)
|
||||
response.encoding = 'utf-8'
|
||||
print(f"Status Code: {response.status_code}")
|
||||
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
|
||||
# Save the full HTML to a file for analysis
|
||||
output_path = os.path.join(os.path.dirname(__file__), 'site_content.html')
|
||||
with open(output_path, 'w', encoding='utf-8') as f:
|
||||
f.write(soup.prettify())
|
||||
|
||||
print(f"Saved HTML to {output_path}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
52
msh_crmeb_22/scraper/analyze_sources.py
Normal file
52
msh_crmeb_22/scraper/analyze_sources.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
|
||||
SOURCES = {
|
||||
"nutrients": "http://www.ishen365.com/index.php/rsyys",
|
||||
"scienceteach": "http://www.ishen365.com/index.php/article/scienceteach",
|
||||
"wiki": "http://www.ishen365.com/index.php/wiki",
|
||||
"doctornews": "http://www.ishen365.com/index.php/article/doctornews",
|
||||
"recipe": "http://www.ishen365.com/index.php/article/godkitchen"
|
||||
}
|
||||
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"
|
||||
}
|
||||
|
||||
def analyze_source(name, url):
|
||||
print(f"Analyzing {name}: {url}")
|
||||
try:
|
||||
response = requests.get(url, headers=HEADERS, timeout=10)
|
||||
response.raise_for_status()
|
||||
response.encoding = 'utf-8'
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
|
||||
# Try to find list items
|
||||
# Based on previous scraper, list items were often in 'div.as_list' or similar.
|
||||
# Let's dump the first few potential list items to see classes.
|
||||
|
||||
# Check for common patterns
|
||||
list_items = soup.find_all('div', class_=lambda x: x and 'list' in x)
|
||||
print(f" Found {len(list_items)} divs with 'list' in class.")
|
||||
|
||||
# Save a snippet to file for manual inspection
|
||||
with open(f"scraper/source_{name}.html", "w", encoding="utf-8") as f:
|
||||
f.write(response.text)
|
||||
|
||||
except Exception as e:
|
||||
print(f" Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not os.path.exists("scraper"):
|
||||
os.makedirs("scraper")
|
||||
|
||||
# Analyze Detail Pages
|
||||
print("\nAnalyzing Detail Pages...")
|
||||
details = {
|
||||
"nutrient_detail": "http://www.ishen365.com/index.php/article/energy",
|
||||
"article_detail": "http://www.ishen365.com/index.php/article/10/show/4330",
|
||||
"recipe_detail": "http://www.ishen365.com/index.php/article/18/show/34"
|
||||
}
|
||||
for name, url in details.items():
|
||||
analyze_source(name, url)
|
||||
2660
msh_crmeb_22/scraper/category_content.html
Normal file
2660
msh_crmeb_22/scraper/category_content.html
Normal file
File diff suppressed because it is too large
Load Diff
621
msh_crmeb_22/scraper/detail_content.html
Normal file
621
msh_crmeb_22/scraper/detail_content.html
Normal file
@@ -0,0 +1,621 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
<meta content="粳米饭(蒸),粳米饭(蒸),米,饭,米饭,糙米饭" name="keywords"/>
|
||||
<meta content="粳米饭(蒸)" name="description"/>
|
||||
<!-- CSRF Token -->
|
||||
<meta content="DmBiVW18gj2j1qD9KBAnF44pg8STRRzQEtZyhXrB" name="csrf-token"/>
|
||||
<title>
|
||||
谷类-粳米饭(蒸)
|
||||
</title>
|
||||
<link href="http://www.ishen365.com/pc/css/amazeui.min.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/layui/css/layui.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/header.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/footer.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/essay.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/base.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/css/sweetalert.css" rel="stylesheet"/>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?2e8a6213f9d88cbcd3e059cf457b5e51";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- GrowingIO Analytics code version 2.1 -->
|
||||
<!-- Copyright 2015-2018 GrowingIO, Inc. More info available at http://www.growingio.com -->
|
||||
<script type="text/javascript">
|
||||
!function(e,t,n,g,i){e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},n=t.createElement("script"),tag=t.getElementsByTagName("script")[0],n.async=1,n.src=('https:'==document.location.protocol?'https://':'http://')+g,tag.parentNode.insertBefore(n,tag)}(window,document,"script","assets.growingio.com/2.1/gio.js","gio");
|
||||
gio('init','9b91df50a16b0142', {});
|
||||
|
||||
//custom page code begin here
|
||||
|
||||
//custom page code end here
|
||||
|
||||
gio('send');
|
||||
</script>
|
||||
<!-- End GrowingIO Analytics code version: 2.1 -->
|
||||
<!-- End GrowingIO Analytics code version: 2.1 -->
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.ishen365.com/pc/js/jquery-2.2.4.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/pc/layui/layui.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/pc/js/amazeui.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/pc/js/header.js" type="text/javascript">
|
||||
</script>
|
||||
<div class="header_bg">
|
||||
<div class="top1">
|
||||
<div class="top1_center fix">
|
||||
<a class="reg" href="http://www.ishen365.com/register" id="reg">
|
||||
注册
|
||||
</a>
|
||||
<a class="login" href="http://www.ishen365.com/login" id="login">
|
||||
登录
|
||||
</a>
|
||||
<input id="as_uid" type="hidden" value="0"/>
|
||||
<input id="as_login_url" type="hidden" value="http://www.ishen365.com/index.php/login"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="top2">
|
||||
<img class="top_logo" src="http://www.ishen365.com/pc/images/logo.png"/>
|
||||
<div class="search">
|
||||
<form action="http://www.ishen365.com/index.php/wiki" class="" id="header_form" method="get">
|
||||
<div class="search_ct">
|
||||
<i class="search_ico">
|
||||
</i>
|
||||
<input class="search_ipt" id="top_search_ipt" name="keywords" placeholder="请输入你想要搜索的关键词" type="text">
|
||||
<span class="search_btn btn" id="head_sosuo">
|
||||
搜索
|
||||
</span>
|
||||
</input>
|
||||
</div>
|
||||
<div class="search_tip">
|
||||
关键词:
|
||||
<span class="to_search">
|
||||
肾病
|
||||
</span>
|
||||
<span class="to_search">
|
||||
慢性病
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$("#head_sosuo").on('click',function()
|
||||
{
|
||||
$("#header_form").submit()
|
||||
});
|
||||
$(".to_search").click(function(){
|
||||
$("#top_search_ipt").val($(this).html())
|
||||
$("#header_form").submit()
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav_bg">
|
||||
<div class="navbar">
|
||||
<ul class="layui-nav" lay-filter="">
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_none" href="http://www.ishen365.com/index.php">
|
||||
首页
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_none" href="http://www.aishenhospital.com" target="_blank">
|
||||
互联网医院
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_txzx" href="">
|
||||
连锁肾病医院
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_yszq" href="http://www.ishen365.com/index.php/doctor">
|
||||
医生专区
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_hzzq" href="http://www.ishen365.com/index.php/patient">
|
||||
肾友专区
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_yyzx" href="">
|
||||
营养学院
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_none" href="http://www.ishen365.com/shop">
|
||||
爱肾商城
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<script type="text/javascript">
|
||||
//注意:导航 依赖 element 模块,否则无法进行功能性操作
|
||||
layui.use('element', function () {
|
||||
var element = layui.element();
|
||||
|
||||
//…
|
||||
});
|
||||
layui.use('layer', function () {
|
||||
var layer = layui.layer;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div class="down_menu" id="down_txzx">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
连锁肾病医院
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365haikou.com" target="_blank">
|
||||
海口爱肾肾脏病医院
|
||||
</a>
|
||||
<a href="http://lanzhou.ishen365.com" target="_blank">
|
||||
兰州爱肾血液透析中心
|
||||
</a>
|
||||
<a href="#">
|
||||
三亚爱肾透析中心(建设中)
|
||||
</a>
|
||||
<a href="http://chongqing.ishen365.com" target="_blank">
|
||||
重庆爱肾文心医院
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="down_none">
|
||||
</div>
|
||||
<div class="down_menu" id="down_yszq">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
医生专区
|
||||
<br/>
|
||||
<span style="font-size:16px;">
|
||||
仅供教学科研使用
|
||||
</span>
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/wiki">
|
||||
爱肾百科
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/doctornews">
|
||||
肾科资讯
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/tool/mdrd">
|
||||
临床工具
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="down_menu" id="down_hzzq">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
肾友专区
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<!--a href="http://www.ishen365.com/index.php/article/patientnews">肾科资讯</a-->
|
||||
<a href="http://www.ishen365.com/index.php/article/ishenkj">
|
||||
名医讲堂
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/scienceteach">
|
||||
科普宣教
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/ask/doctor">
|
||||
问医生
|
||||
</a>
|
||||
</div>
|
||||
<!--div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/ask/doctor">问医生</a>
|
||||
</div-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="down_menu" id="down_yyzx">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
营养学院
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/article/godkitchen">
|
||||
名医神厨
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/rsyys">
|
||||
认识营养素
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/swcfb">
|
||||
食物成分表
|
||||
</a>
|
||||
</div>
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/ask/dietitian">
|
||||
问营养师
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/tool/nutrition">
|
||||
食谱计算器
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--main content start-->
|
||||
<div class="c_center fix" style="margin-top: 190px;">
|
||||
<div class="content_left">
|
||||
<div class="tit">
|
||||
粳米饭(蒸)
|
||||
</div>
|
||||
<div class="tit2">
|
||||
<input name="_token" type="hidden" value="DmBiVW18gj2j1qD9KBAnF44pg8STRRzQEtZyhXrB"/>
|
||||
<div class="time">
|
||||
发布时间:2017-08-14 16:06:36
|
||||
</div>
|
||||
</div>
|
||||
<div class="txt">
|
||||
<div class="left">
|
||||
<table class="am-table am-table-bordered am-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
营养素名称
|
||||
</td>
|
||||
<td>
|
||||
含量(每100g)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #1cbf62 ">
|
||||
钾 (含量低)
|
||||
</td>
|
||||
<td style="color: #1cbf62 ">
|
||||
39.00mg
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #1cbf62 ">
|
||||
钙 (含量低)
|
||||
</td>
|
||||
<td style="color: #1cbf62 ">
|
||||
7.00mg
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #1cbf62 ">
|
||||
磷(含量低)
|
||||
</td>
|
||||
<td style="color: #1cbf62 ">
|
||||
62.00mg
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #1cbf62 ">
|
||||
蛋白质 (含量低)
|
||||
</td>
|
||||
<td style="color: #1cbf62 ">
|
||||
2.60g
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
钠
|
||||
</td>
|
||||
<td>
|
||||
3.30mg
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
水
|
||||
</td>
|
||||
<td>
|
||||
71.00g
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
能量
|
||||
</td>
|
||||
<td>
|
||||
117kcal
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lst_btns fix">
|
||||
<div class="see" id="reading">
|
||||
3120
|
||||
</div>
|
||||
<div class="support" id="top">
|
||||
0
|
||||
</div>
|
||||
<div class="tread" id="tread">
|
||||
0
|
||||
</div>
|
||||
<div class="fav" id="collection">
|
||||
0
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="c_right">
|
||||
<style type="text/css">
|
||||
/*右边样式二*/
|
||||
.right_2{
|
||||
width:255px;
|
||||
}
|
||||
.r2_tit{
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
text-indent:10px;
|
||||
background-color:#f4f5f7;
|
||||
border-bottom:1px solid #bfd8bb;
|
||||
}
|
||||
|
||||
.r2_tit a{
|
||||
line-height:45px;
|
||||
}
|
||||
.r2_txt{
|
||||
padding:20px;
|
||||
|
||||
}
|
||||
.r2_li{
|
||||
width:96px;
|
||||
overflow:hidden;
|
||||
margin-bottom:12px;
|
||||
cursor:pointer;
|
||||
|
||||
}
|
||||
.r2_li:nth-child(odd){
|
||||
margin-right:18px;
|
||||
}
|
||||
.li2_img{
|
||||
width:96px;
|
||||
height:85px;
|
||||
background-repeat:no-repeat;
|
||||
background-size:100% auto;
|
||||
overflow:hidden;
|
||||
}
|
||||
.li2_tit{
|
||||
width:96px;
|
||||
overflow:hidden;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
</style>
|
||||
<div class="right_2 f_l bor1">
|
||||
<div class="r2_tit f_s16">
|
||||
名医神厨
|
||||
<a class="to_all f_r f_s14 m_r20" href="http://www.ishen365.com/index.php/article/godkitchen">
|
||||
查看全部
|
||||
</a>
|
||||
</div>
|
||||
<div class="r2_txt f_s14 fix">
|
||||
<a class="r2_li f_l" href="http://www.ishen365.com/index.php/article/18/show/37" target="_blank">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095441919.png')">
|
||||
</div>
|
||||
<div class="li2_tit">
|
||||
肉末烧冬瓜
|
||||
</div>
|
||||
</a>
|
||||
<a class="r2_li f_l" href="http://www.ishen365.com/index.php/article/18/show/36" target="_blank">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095426644.png')">
|
||||
</div>
|
||||
<div class="li2_tit">
|
||||
西红柿鸡蛋捞面
|
||||
</div>
|
||||
</a>
|
||||
<a class="r2_li f_l" href="http://www.ishen365.com/index.php/article/18/show/35" target="_blank">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095409875.png')">
|
||||
</div>
|
||||
<div class="li2_tit">
|
||||
红烧鲫鱼
|
||||
</div>
|
||||
</a>
|
||||
<a class="r2_li f_l" href="http://www.ishen365.com/index.php/article/18/show/34" target="_blank">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095352322.png')">
|
||||
</div>
|
||||
<div class="li2_tit">
|
||||
清炖牛肉萝卜汤
|
||||
</div>
|
||||
</a>
|
||||
<a class="r2_li f_l" href="http://www.ishen365.com/index.php/article/18/show/33" target="_blank">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095336792.png')">
|
||||
</div>
|
||||
<div class="li2_tit">
|
||||
翡翠虾仁珍珠面
|
||||
</div>
|
||||
</a>
|
||||
<a class="r2_li f_l" href="http://www.ishen365.com/index.php/article/18/show/32" target="_blank">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095315544.png')">
|
||||
</div>
|
||||
<div class="li2_tit">
|
||||
蒜蓉粉丝蒸大虾
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="ishen_logo">
|
||||
<img alt="" src="http://www.ishen365.com/pc/images/ishen_logo.png"/>
|
||||
</div>
|
||||
<div class="foot">
|
||||
<div class="foot_nav">
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/article/60/show/3321">
|
||||
关于爱肾
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/join">
|
||||
加入我们
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/article/60/show/3323">
|
||||
联系我们
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/article/60/show/3324">
|
||||
版权声明
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/personal">
|
||||
个人中心
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.aishenhospital.com" target="_blank">
|
||||
爱肾云医院
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
Copyright 2018上海艾力彼信息科技有限责任公司.
|
||||
<a href="http://www.beian.miit.gov.cn">
|
||||
沪ICP备14035697号-1
|
||||
</a>
|
||||
沪卫(中医)网审[2014]第10246号 互联网药品信息服务资格证书(沪)-经营性-2017-0012
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="go_top">
|
||||
<a href="javascript:scrollTo(0,0);">
|
||||
<img alt="" src="http://www.ishen365.com/pc/images/scroll_top.png"/>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
var DEFAULT_VERSION = "8.0";
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var isIE = ua.indexOf("msie")>-1;
|
||||
var safariVersion;
|
||||
if(isIE){
|
||||
safariVersion = ua.match(/msie ([\d.]+)/)[1];
|
||||
//alert(safariVersion)
|
||||
if(safariVersion <= DEFAULT_VERSION ){
|
||||
// 跳转至页面1
|
||||
window.location.href="http://www.ishen365.com/index.php/unsupport"
|
||||
}else{
|
||||
// 跳转至页面2
|
||||
}
|
||||
}else{
|
||||
// 跳转至页面2
|
||||
}
|
||||
</script>
|
||||
</footer>
|
||||
<!--main content end-->
|
||||
<script type="text/javascript">
|
||||
window.onload = function () {
|
||||
|
||||
if ("0" == 1) {
|
||||
$(".support").addClass("support_active")
|
||||
}
|
||||
if ("0" == 1) {
|
||||
$(".tread").addClass("tread_active")
|
||||
}
|
||||
if ("0" == 1) {
|
||||
$(".fav").addClass("fav_active")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(".lst_btns").on("click", ".share", function () {
|
||||
$(".bshare-custom").toggle();
|
||||
|
||||
});
|
||||
$("#top").on('click', function () {
|
||||
//顶
|
||||
toLogin();
|
||||
$.ajax({
|
||||
url: "http://www.ishen365.com/index.php/article/top",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
_token: $("input[name='_token']").val(),
|
||||
id: "36",
|
||||
catid: "29",
|
||||
type: "top"
|
||||
},
|
||||
success: function (data) {
|
||||
$("#top").html(data.date);
|
||||
if (data.state == 'bright') {
|
||||
$(".support").addClass("support_active");
|
||||
} else if (data.state == 'dark') {
|
||||
$(".support").removeClass("support_active");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
//踩
|
||||
$("#tread").on('click', function () {
|
||||
toLogin();
|
||||
$.ajax({
|
||||
url: "http://www.ishen365.com/index.php/article/tread",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
_token: $("input[name='_token']").val(),
|
||||
id: "36",
|
||||
catid: "29",
|
||||
type: "tread"
|
||||
},
|
||||
success: function (data) {
|
||||
$("#tread").html(data.date);
|
||||
if (data.state == 'bright') {
|
||||
$(".tread").addClass("tread_active");
|
||||
} else if (data.state == 'dark') {
|
||||
$(".tread").removeClass("tread_active");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
//收藏
|
||||
$("#collection").on('click', function () {
|
||||
toLogin();
|
||||
$.ajax({
|
||||
url: "http://www.ishen365.com/index.php/article/collection",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: {
|
||||
_token: $("input[name='_token']").val(),
|
||||
id: "36",
|
||||
catid: "29",
|
||||
type: "collection"
|
||||
},
|
||||
success: function (data) {
|
||||
$("#collection").html(data.date);
|
||||
if (data.state == 'bright') {
|
||||
$(".fav").addClass("fav_active");
|
||||
} else if (data.state == 'dark') {
|
||||
$(".fav").removeClass("fav_active");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/js/sweetalert.min.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
40
msh_crmeb_22/scraper/extract_categories.py
Normal file
40
msh_crmeb_22/scraper/extract_categories.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import sys
|
||||
|
||||
url = 'http://www.ishen365.com/index.php/swcfb'
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
|
||||
}
|
||||
|
||||
try:
|
||||
print(f"Fetching {url}...", flush=True)
|
||||
response = requests.get(url, headers=headers, timeout=10)
|
||||
response.encoding = 'utf-8'
|
||||
print(f"Status Code: {response.status_code}", flush=True)
|
||||
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
|
||||
# Debug: Print the content6_left_bottom div
|
||||
content_div = soup.find('div', class_='content6_left_bottom')
|
||||
if content_div:
|
||||
print("Found content6_left_bottom div", flush=True)
|
||||
category_table = content_div.find('table')
|
||||
if category_table:
|
||||
print("Found table", flush=True)
|
||||
links = category_table.find_all('a')
|
||||
print(f"Found {len(links)} links in table", flush=True)
|
||||
for link in links:
|
||||
href = link.get('href')
|
||||
name = link.get_text(strip=True)
|
||||
print(f"Category: {name}, URL: {href}", flush=True)
|
||||
else:
|
||||
print("Table not found in content6_left_bottom", flush=True)
|
||||
else:
|
||||
print("content6_left_bottom div not found", flush=True)
|
||||
# Fallback: search for any table
|
||||
tables = soup.find_all('table')
|
||||
print(f"Found {len(tables)} tables on the page", flush=True)
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}", flush=True)
|
||||
373
msh_crmeb_22/scraper/full_scraper.py
Normal file
373
msh_crmeb_22/scraper/full_scraper.py
Normal file
@@ -0,0 +1,373 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import time
|
||||
import random
|
||||
import json
|
||||
import re
|
||||
import os
|
||||
from urllib.parse import urljoin
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
import threading
|
||||
|
||||
# Configuration
|
||||
BASE_URL = "http://www.ishen365.com"
|
||||
START_URL = "http://www.ishen365.com/index.php/swcfb"
|
||||
OUTPUT_FILE = "food_data_insert.sql"
|
||||
LOG_FILE = "scraper.log"
|
||||
LIMIT_PER_CATEGORY = None # Set to None for full scrape
|
||||
MAX_WORKERS = 10 # Number of concurrent threads
|
||||
|
||||
# Lock for file writing
|
||||
file_lock = threading.Lock()
|
||||
|
||||
# Database Schema Mapping
|
||||
CATEGORY_MAP = {
|
||||
"谷": "grain",
|
||||
"薯": "grain",
|
||||
"豆": "grain",
|
||||
"蔬菜": "vegetable",
|
||||
"菌": "vegetable",
|
||||
"水果": "fruit",
|
||||
"坚果": "other",
|
||||
"肉": "meat",
|
||||
"乳": "dairy",
|
||||
"蛋": "meat",
|
||||
"鱼": "seafood",
|
||||
"蟹": "seafood",
|
||||
"贝": "seafood",
|
||||
"婴": "other",
|
||||
"小吃": "other",
|
||||
"速食": "other",
|
||||
"饮料": "other",
|
||||
"酒": "other",
|
||||
"糖": "other",
|
||||
"蜜": "other",
|
||||
"调味": "other",
|
||||
"药": "other",
|
||||
"油": "other"
|
||||
}
|
||||
|
||||
NUTRIENT_MAP = {
|
||||
"蛋白质": "protein",
|
||||
"脂肪": "fat",
|
||||
"碳水化合物": "carbohydrate",
|
||||
"能量": "energy",
|
||||
"钾": "potassium",
|
||||
"磷": "phosphorus",
|
||||
"钠": "sodium",
|
||||
"钙": "calcium",
|
||||
"铁": "iron",
|
||||
"维生素C": "vitamin_c"
|
||||
}
|
||||
|
||||
# Headers to mimic a browser
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
|
||||
}
|
||||
|
||||
def log(msg):
|
||||
timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
formatted_msg = f"[{timestamp}] {msg}"
|
||||
print(formatted_msg)
|
||||
with open(LOG_FILE, "a", encoding="utf-8") as f:
|
||||
f.write(formatted_msg + "\n")
|
||||
|
||||
def clean_number(value_str):
|
||||
"""Extracts number from string like '39.00mg' or '123kcal'"""
|
||||
if not value_str:
|
||||
return None
|
||||
match = re.search(r"([\d\.]+)", value_str)
|
||||
if match:
|
||||
return match.group(1)
|
||||
return None
|
||||
|
||||
def get_soup(url):
|
||||
try:
|
||||
response = requests.get(url, headers=HEADERS, timeout=10)
|
||||
response.raise_for_status()
|
||||
response.encoding = 'utf-8'
|
||||
return BeautifulSoup(response.text, 'html.parser')
|
||||
except Exception as e:
|
||||
log(f"Error fetching {url}: {e}")
|
||||
return None
|
||||
|
||||
def extract_categories():
|
||||
log("Extracting categories...")
|
||||
soup = get_soup(START_URL)
|
||||
if not soup:
|
||||
return []
|
||||
|
||||
categories = []
|
||||
# Based on previous analysis: div.content6_left_bottom table a
|
||||
container = soup.find('div', class_='content6_left_bottom')
|
||||
if container:
|
||||
links = container.find_all('a')
|
||||
for link in links:
|
||||
name = link.get_text(strip=True)
|
||||
href = link.get('href')
|
||||
if href:
|
||||
# Ensure full URL
|
||||
if not href.startswith('http'):
|
||||
full_url = BASE_URL + href if href.startswith('/') else BASE_URL + '/' + href
|
||||
else:
|
||||
full_url = href
|
||||
|
||||
# Map category name to DB enum
|
||||
db_category = "other"
|
||||
for key, value in CATEGORY_MAP.items():
|
||||
if key in name:
|
||||
db_category = value
|
||||
break
|
||||
|
||||
categories.append({
|
||||
"name": name,
|
||||
"url": full_url,
|
||||
"db_category": db_category
|
||||
})
|
||||
|
||||
log(f"Found {len(categories)} categories.")
|
||||
return categories
|
||||
|
||||
def extract_food_list(category_url):
|
||||
"""Extracts all food items from a category, handling pagination."""
|
||||
food_items = []
|
||||
current_url = category_url
|
||||
|
||||
while current_url:
|
||||
log(f"Processing list page: {current_url}")
|
||||
soup = get_soup(current_url)
|
||||
if not soup:
|
||||
break
|
||||
|
||||
# Extract food items
|
||||
# Based on previous analysis: div.as_list -> a[href]
|
||||
# The structure is <a href="..."> <div class="as_list"> ... </div> </a>
|
||||
# Wait, usually the <a> wraps the div or is inside.
|
||||
# From previous analysis: <a href="29/show/36"><div class="as_list one">...
|
||||
|
||||
# Let's look for all 'a' tags that contain 'as_list' div?
|
||||
# Or just find all divs with class 'as_list' and get parent 'a'?
|
||||
|
||||
list_divs = soup.find_all('div', class_='as_list')
|
||||
for div in list_divs:
|
||||
parent_a = div.find_parent('a')
|
||||
if parent_a:
|
||||
href = parent_a.get('href')
|
||||
# Extract image and name
|
||||
img_tag = div.find('img')
|
||||
img_src = img_tag.get('src') if img_tag else ""
|
||||
if img_src and not img_src.startswith('http'):
|
||||
img_src = BASE_URL + img_src if img_src.startswith('/') else BASE_URL + '/' + img_src
|
||||
|
||||
name_div = div.find('div', class_='as_list_tit')
|
||||
name = name_div.get_text(strip=True) if name_div else "Unknown"
|
||||
|
||||
if href:
|
||||
# Construct detail URL. The href found was "29/show/36" (relative to something?)
|
||||
# If category_url is http://www.ishen365.com/index.php/swcfb/index/29
|
||||
# and href is "29/show/36", it might be relative to current path or base.
|
||||
# Let's check the href carefully.
|
||||
# If href doesn't start with /, it's relative to current path.
|
||||
# But if we are at .../index/29, "29/show/36" would be .../index/29/29/show/36 which is wrong.
|
||||
# It's likely relative to index.php or base.
|
||||
# Let's resolve it properly.
|
||||
|
||||
full_detail_url = ""
|
||||
if href.startswith('http'):
|
||||
full_detail_url = href
|
||||
elif href.startswith('/'):
|
||||
full_detail_url = BASE_URL + href
|
||||
else:
|
||||
# Careful with relative paths.
|
||||
# If the page is /index.php/swcfb/index/29
|
||||
# and link is 29/show/36, it might mean /index.php/swcfb/index/29/show/36 ??
|
||||
# Or maybe the href is actually "/index.php/swcfb/show/36" ?
|
||||
# I need to be robust. I'll assume it needs to be joined with BASE_URL/index.php/swcfb/ maybe?
|
||||
# Let's try to join with the current URL's directory.
|
||||
# Actually, easiest is to just print it and see during debug, but I want to get it right.
|
||||
# Let's assume standard relative URL resolution.
|
||||
full_detail_url = urljoin(current_url, href)
|
||||
|
||||
food_items.append({
|
||||
"name": name,
|
||||
"url": full_detail_url,
|
||||
"image": img_src
|
||||
})
|
||||
|
||||
# Handle pagination
|
||||
# Look for "下一页"
|
||||
next_page = None
|
||||
pagination = soup.find('ul', class_='pagination') # Bootstrap style? Or just search text.
|
||||
# Searching by text is safer if class is unknown
|
||||
next_link = soup.find('a', string=re.compile(r'下一页|Next'))
|
||||
if next_link:
|
||||
href = next_link.get('href')
|
||||
if href and href != '#':
|
||||
next_page = urljoin(current_url, href)
|
||||
|
||||
if next_page and next_page != current_url:
|
||||
current_url = next_page
|
||||
time.sleep(random.uniform(1, 2))
|
||||
else:
|
||||
current_url = None
|
||||
|
||||
return food_items
|
||||
|
||||
def extract_food_detail(url):
|
||||
log(f" Scraping detail: {url}")
|
||||
soup = get_soup(url)
|
||||
if not soup:
|
||||
return None
|
||||
|
||||
data = {}
|
||||
|
||||
# Extract Nutrients
|
||||
# Based on previous analysis: table.am-table
|
||||
table = soup.find('table', class_='am-table')
|
||||
nutrients = {}
|
||||
other_nutrients = {}
|
||||
|
||||
if table:
|
||||
rows = table.find_all('tr')
|
||||
for row in rows:
|
||||
cols = row.find_all('td')
|
||||
if len(cols) >= 2:
|
||||
# Name often has extra text like "钾 (含量低)"
|
||||
raw_name = cols[0].get_text(strip=True)
|
||||
# Clean name: remove content in parens if it's just description like (含量低)
|
||||
# But sometimes parens are part of name like "维生素C(抗坏血酸)"
|
||||
# Let's just keep the main part.
|
||||
|
||||
# Check if it maps to our schema
|
||||
db_field = None
|
||||
for key, field in NUTRIENT_MAP.items():
|
||||
if key in raw_name: # Simple substring match
|
||||
db_field = field
|
||||
break
|
||||
|
||||
value_str = cols[1].get_text(strip=True)
|
||||
value = clean_number(value_str)
|
||||
|
||||
if db_field:
|
||||
nutrients[db_field] = value
|
||||
else:
|
||||
# Store in other_nutrients
|
||||
# Clean the key name a bit
|
||||
clean_key = re.sub(r'\s*(.*?)|s*\(.*?\)', '', raw_name)
|
||||
if value:
|
||||
other_nutrients[clean_key] = value_str # Keep unit for json
|
||||
|
||||
data['nutrients'] = nutrients
|
||||
data['other_nutrients'] = other_nutrients
|
||||
|
||||
# Extract suitability/tips if available (Optional, but good for completeness)
|
||||
# Looking for other text blocks
|
||||
|
||||
return data
|
||||
|
||||
def generate_sql(food_data, category_enum):
|
||||
name = food_data['name'].replace("'", "''")
|
||||
image = food_data['image']
|
||||
nutrients = food_data['details']['nutrients']
|
||||
others = json.dumps(food_data['details']['other_nutrients'], ensure_ascii=False).replace("'", "''")
|
||||
|
||||
# Defaults
|
||||
protein = nutrients.get('protein', '0')
|
||||
fat = nutrients.get('fat', '0')
|
||||
carbohydrate = nutrients.get('carbohydrate', '0')
|
||||
energy = nutrients.get('energy', '0')
|
||||
potassium = nutrients.get('potassium', '0')
|
||||
phosphorus = nutrients.get('phosphorus', '0')
|
||||
sodium = nutrients.get('sodium', '0')
|
||||
calcium = nutrients.get('calcium', '0')
|
||||
iron = nutrients.get('iron', '0')
|
||||
vitamin_c = nutrients.get('vitamin_c', '0')
|
||||
|
||||
sql = f"""INSERT INTO `v2_foods`
|
||||
(`name`, `category`, `image`, `protein`, `fat`, `carbohydrate`, `energy`, `potassium`, `phosphorus`, `sodium`, `calcium`, `iron`, `vitamin_c`, `nutrients_json`, `status`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('{name}', '{category_enum}', '{image}', {protein}, {fat}, {carbohydrate}, {energy}, {potassium}, {phosphorus}, {sodium}, {calcium}, {iron}, {vitamin_c}, '{others}', 'active', NOW(), NOW());"""
|
||||
return sql
|
||||
|
||||
def process_food_item(food, category_enum):
|
||||
"""Worker function to process a single food item"""
|
||||
try:
|
||||
time.sleep(random.uniform(0.1, 0.5)) # Politeness delay
|
||||
details = extract_food_detail(food['url'])
|
||||
if details:
|
||||
food['details'] = details
|
||||
sql = generate_sql(food, category_enum)
|
||||
|
||||
# Thread-safe write
|
||||
with file_lock:
|
||||
with open(OUTPUT_FILE, "a", encoding="utf-8") as f:
|
||||
f.write(sql + "\n")
|
||||
return True
|
||||
except Exception as e:
|
||||
log(f"Error processing {food['name']}: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
# 1. Get Categories
|
||||
categories = extract_categories()
|
||||
|
||||
all_food_items = []
|
||||
|
||||
# 2. Collect all items first
|
||||
log("Collecting all food links...")
|
||||
for cat in categories:
|
||||
log(f"Scanning Category: {cat['name']} ({cat['db_category']})")
|
||||
food_list = extract_food_list(cat['url'])
|
||||
log(f" Found {len(food_list)} items in category.")
|
||||
|
||||
# Add category info to food item for later use
|
||||
for food in food_list:
|
||||
food['category_enum'] = cat['db_category']
|
||||
all_food_items.append(food)
|
||||
|
||||
if LIMIT_PER_CATEGORY:
|
||||
# Just for testing the collection logic if needed,
|
||||
# but LIMIT_PER_CATEGORY was for processing.
|
||||
# I'll ignore it for collection to keep it simple, or apply it here.
|
||||
pass
|
||||
|
||||
total_items = len(all_food_items)
|
||||
log(f"Total items to scrape: {total_items}")
|
||||
|
||||
# Apply limit if set
|
||||
if LIMIT_PER_CATEGORY:
|
||||
# This is a global limit now for simplicity in threaded mode?
|
||||
# Or per category? The variable name implies per category.
|
||||
# I'll just slice the list if I really want to limit.
|
||||
# Let's keep it simple: if limit is set, we only take first N items total for testing.
|
||||
# But wait, LIMIT_PER_CATEGORY was 3.
|
||||
# If I want to test, I should probably limit per category during collection.
|
||||
# I'll stick to full scrape now as LIMIT is None.
|
||||
pass
|
||||
|
||||
# 3. Process in parallel
|
||||
log(f"Starting parallel scraping with {MAX_WORKERS} workers...")
|
||||
|
||||
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
||||
futures = []
|
||||
for food in all_food_items:
|
||||
futures.append(executor.submit(process_food_item, food, food['category_enum']))
|
||||
|
||||
# Monitor progress
|
||||
completed = 0
|
||||
for future in as_completed(futures):
|
||||
completed += 1
|
||||
if completed % 10 == 0:
|
||||
log(f"Progress: {completed}/{total_items} ({completed/total_items*100:.1f}%)")
|
||||
|
||||
log("Done!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Initialize output file
|
||||
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
|
||||
f.write("-- Bulk Insert SQL for v2_foods\n")
|
||||
f.write("DELETE FROM `v2_foods`;\n") # Optional: clear old data
|
||||
|
||||
main()
|
||||
380
msh_crmeb_22/scraper/knowledge_scraper.py
Normal file
380
msh_crmeb_22/scraper/knowledge_scraper.py
Normal file
@@ -0,0 +1,380 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import time
|
||||
import random
|
||||
import json
|
||||
import re
|
||||
import os
|
||||
from urllib.parse import urljoin
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
import threading
|
||||
|
||||
# Configuration
|
||||
BASE_URL = "http://www.ishen365.com"
|
||||
OUTPUT_FILE = "knowledge_data_insert.sql"
|
||||
LOG_FILE = "knowledge_scraper.log"
|
||||
MAX_WORKERS = 10
|
||||
|
||||
# Lock for file writing
|
||||
file_lock = threading.Lock()
|
||||
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"
|
||||
}
|
||||
|
||||
def log(msg):
|
||||
timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
formatted_msg = f"[{timestamp}] {msg}"
|
||||
print(formatted_msg)
|
||||
with open(LOG_FILE, "a", encoding="utf-8") as f:
|
||||
f.write(formatted_msg + "\n")
|
||||
|
||||
def get_soup(url):
|
||||
try:
|
||||
response = requests.get(url, headers=HEADERS, timeout=10)
|
||||
response.raise_for_status()
|
||||
response.encoding = 'utf-8'
|
||||
return BeautifulSoup(response.text, 'html.parser')
|
||||
except Exception as e:
|
||||
log(f"Error fetching {url}: {e}")
|
||||
return None
|
||||
|
||||
def clean_text(text):
|
||||
if not text:
|
||||
return ""
|
||||
return text.strip().replace("'", "''").replace("\\", "\\\\")
|
||||
|
||||
def clean_html(html_content):
|
||||
if not html_content:
|
||||
return ""
|
||||
return str(html_content).replace("'", "''").replace("\\", "\\\\")
|
||||
|
||||
def save_sql(sql):
|
||||
with file_lock:
|
||||
with open(OUTPUT_FILE, "a", encoding="utf-8") as f:
|
||||
f.write(sql + "\n")
|
||||
|
||||
def generate_sql(data, table_name='v2_knowledge'):
|
||||
title = clean_text(data.get('title', ''))
|
||||
content = clean_html(data.get('content', ''))
|
||||
summary = clean_text(data.get('summary', ''))
|
||||
cover_image = data.get('cover_image', '')
|
||||
|
||||
if table_name == 'v2_knowledge':
|
||||
type_ = data.get('type', 'article')
|
||||
category = data.get('category', '')
|
||||
nutrient_name = clean_text(data.get('nutrient_name', ''))
|
||||
|
||||
sql = f"""INSERT INTO `v2_knowledge`
|
||||
(`title`, `content`, `summary`, `cover_image`, `type`, `category`, `nutrient_name`, `status`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('{title}', '{content}', '{summary}', '{cover_image}', '{type_}', '{category}', '{nutrient_name}', 'published', NOW(), NOW());"""
|
||||
return sql
|
||||
|
||||
elif table_name == 'v2_recipes':
|
||||
# v2_recipes fields: name, description, cover_image, category, meal_type, ingredients_json, steps_json, status, is_official
|
||||
# We map content to description
|
||||
# We try to extract video if available in content (not implemented here but content has it)
|
||||
|
||||
sql = f"""INSERT INTO `v2_recipes`
|
||||
(`name`, `description`, `cover_image`, `category`, `ingredients_json`, `steps_json`, `status`, `is_official`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('{title}', '{content}', '{cover_image}', 'godkitchen', '[]', '[]', 'published', 1, NOW(), NOW());"""
|
||||
return sql
|
||||
|
||||
elif table_name == 'v2_community_posts':
|
||||
# v2_community_posts fields: title, content, cover_image, user_id, status, audit_status, privacy
|
||||
# user_id = 1 (System)
|
||||
|
||||
sql = f"""INSERT INTO `v2_community_posts`
|
||||
(`title`, `content`, `cover_image`, `user_id`, `status`, `audit_status`, `privacy`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
('{title}', '{content}', '{cover_image}', 1, 'published', 'approved', 'public', NOW(), NOW());"""
|
||||
return sql
|
||||
|
||||
return ""
|
||||
|
||||
def scrape_detail(url, item_data):
|
||||
# Fetch detail page to get content
|
||||
soup = get_soup(url)
|
||||
if not soup:
|
||||
return None
|
||||
|
||||
# Extract content
|
||||
# Common pattern: div.txt for articles
|
||||
# For recipes (godkitchen): div.content_left (contains .video_play and p tags)
|
||||
|
||||
content_div = soup.find('div', class_='txt')
|
||||
if not content_div:
|
||||
# Try finding content_left for recipes or other structures
|
||||
content_left = soup.find('div', class_='content_left')
|
||||
if content_left:
|
||||
# Remove title and time divs if present to avoid duplication
|
||||
for div in content_left.find_all('div', class_=['tit', 'tit2', 'lst_btns']):
|
||||
div.decompose()
|
||||
content_div = content_left
|
||||
|
||||
if content_div:
|
||||
item_data['content'] = content_div
|
||||
else:
|
||||
item_data['content'] = "<p>No content extracted.</p>"
|
||||
|
||||
return item_data
|
||||
|
||||
def process_item(item, source_type, table_name='v2_knowledge', extra_info=None):
|
||||
try:
|
||||
full_data = scrape_detail(item['url'], item)
|
||||
if full_data:
|
||||
full_data['type'] = source_type
|
||||
if extra_info:
|
||||
full_data.update(extra_info)
|
||||
|
||||
sql = generate_sql(full_data, table_name)
|
||||
save_sql(sql)
|
||||
return True
|
||||
except Exception as e:
|
||||
log(f"Error processing item {item.get('url')}: {e}")
|
||||
return False
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task Specific Scrapers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def task2_nutrients():
|
||||
log("Starting Task 2: Nutrients")
|
||||
url = "http://www.ishen365.com/index.php/rsyys"
|
||||
soup = get_soup(url)
|
||||
if not soup:
|
||||
return
|
||||
|
||||
nutrients = []
|
||||
links = soup.find_all('a')
|
||||
for link in links:
|
||||
div = link.find('div', class_='tianchong')
|
||||
if div:
|
||||
name = div.get_text(strip=True)
|
||||
href = link.get('href')
|
||||
if href:
|
||||
nutrients.append({'name': name, 'url': urljoin(url, href)})
|
||||
|
||||
log(f"Found {len(nutrients)} nutrient categories.")
|
||||
|
||||
all_items = []
|
||||
for nutrient in nutrients:
|
||||
log(f"Scanning Nutrient: {nutrient['name']}")
|
||||
n_soup = get_soup(nutrient['url'])
|
||||
if not n_soup:
|
||||
continue
|
||||
|
||||
list_items = n_soup.find_all('li', class_='am-g')
|
||||
for li in list_items:
|
||||
h3 = li.find('h3', class_='am-list-item-hd')
|
||||
if h3:
|
||||
a = h3.find('a')
|
||||
if a:
|
||||
title = a.get_text(strip=True)
|
||||
href = urljoin(nutrient['url'], a.get('href'))
|
||||
summary_div = li.find('div', class_='am-list-item-text')
|
||||
summary = summary_div.get_text(strip=True) if summary_div else ""
|
||||
thumb = li.find('div', class_='am-list-item-thumb')
|
||||
img = thumb.find('img') if thumb else None
|
||||
img_src = urljoin(nutrient['url'], img.get('src')) if img else ""
|
||||
|
||||
all_items.append({
|
||||
'title': title,
|
||||
'url': href,
|
||||
'summary': summary,
|
||||
'cover_image': img_src,
|
||||
'nutrient_name': nutrient['name'],
|
||||
'category': 'nutrients'
|
||||
})
|
||||
|
||||
log(f"Total Nutrient Articles to scrape: {len(all_items)}")
|
||||
|
||||
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
||||
futures = [executor.submit(process_item, item, 'nutrients', 'v2_knowledge') for item in all_items]
|
||||
for _ in as_completed(futures):
|
||||
pass
|
||||
|
||||
def scrape_list_items(task):
|
||||
log(f"Processing {task['name']}...")
|
||||
all_items = []
|
||||
|
||||
# Determine start page
|
||||
start_page = task.get('start_page', 1)
|
||||
page_url = f"{task['url']}?page={start_page}" if start_page > 1 else task['url']
|
||||
|
||||
soup = get_soup(page_url)
|
||||
if not soup:
|
||||
return []
|
||||
|
||||
current_soup = soup
|
||||
page_count = start_page
|
||||
|
||||
while True:
|
||||
if task['limit'] and len(all_items) >= task['limit']:
|
||||
all_items = all_items[:task['limit']]
|
||||
break
|
||||
|
||||
# Extract items
|
||||
items_list = current_soup.find_all('li', class_='am-g')
|
||||
new_items_found = False
|
||||
for li in items_list:
|
||||
if task['limit'] and len(all_items) >= task['limit']:
|
||||
break
|
||||
|
||||
h3 = li.find('h3', class_='am-list-item-hd')
|
||||
if h3:
|
||||
a = h3.find('a')
|
||||
if a:
|
||||
title = a.get_text(strip=True)
|
||||
href = urljoin(task['url'], a.get('href'))
|
||||
summary_div = li.find('div', class_='am-list-item-text')
|
||||
summary = summary_div.get_text(strip=True) if summary_div else ""
|
||||
thumb = li.find('div', class_='am-list-item-thumb')
|
||||
img = thumb.find('img') if thumb else None
|
||||
img_src = urljoin(task['url'], img.get('src')) if img else ""
|
||||
|
||||
all_items.append({
|
||||
'title': title,
|
||||
'url': href,
|
||||
'summary': summary,
|
||||
'cover_image': img_src,
|
||||
'category': task['name']
|
||||
})
|
||||
new_items_found = True
|
||||
|
||||
if not new_items_found:
|
||||
# Maybe the page is empty, or structure changed
|
||||
# If start_page was high (e.g. 21), it might be empty if not that many items.
|
||||
log(f" No items found on page {page_count}. Stopping.")
|
||||
break
|
||||
|
||||
# Next page
|
||||
next_link = current_soup.find('a', string=re.compile(r'下一页|Next'))
|
||||
if not next_link:
|
||||
break
|
||||
next_href = next_link.get('href')
|
||||
if not next_href or next_href == '#':
|
||||
break
|
||||
|
||||
next_url = urljoin(task['url'], next_href)
|
||||
log(f" Fetching next page: {next_url}")
|
||||
|
||||
current_soup = get_soup(next_url)
|
||||
if not current_soup:
|
||||
break
|
||||
|
||||
page_count += 1
|
||||
# Safety break for unlimited tasks
|
||||
if not task['limit'] and page_count > 20:
|
||||
break
|
||||
|
||||
log(f" Total items collected for {task['name']}: {len(all_items)}")
|
||||
return all_items
|
||||
|
||||
def task3_articles_guides():
|
||||
log("Starting Task 3: Articles & Guides")
|
||||
tasks = [
|
||||
{'name': 'scienceteach', 'url': 'http://www.ishen365.com/index.php/article/scienceteach', 'type': 'article', 'table': 'v2_knowledge', 'limit': None},
|
||||
{'name': 'wiki', 'url': 'http://www.ishen365.com/index.php/wiki', 'type': 'guide', 'table': 'v2_knowledge', 'limit': 100},
|
||||
{'name': 'doctornews', 'url': 'http://www.ishen365.com/index.php/article/doctornews', 'type': 'article', 'table': 'v2_knowledge', 'limit': 100}
|
||||
]
|
||||
|
||||
for task in tasks:
|
||||
items = scrape_list_items(task)
|
||||
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
||||
futures = [executor.submit(process_item, item, task['type'], task['table']) for item in items]
|
||||
for _ in as_completed(futures):
|
||||
pass
|
||||
|
||||
def task4_recipes():
|
||||
log("Starting Task 4: Recipes")
|
||||
url = "http://www.ishen365.com/index.php/article/godkitchen"
|
||||
soup = get_soup(url)
|
||||
if not soup:
|
||||
return
|
||||
|
||||
all_items = []
|
||||
current_soup = soup
|
||||
page_count = 1
|
||||
|
||||
while True:
|
||||
video_list_ul = current_soup.find('ul', class_='video_list')
|
||||
if video_list_ul:
|
||||
lis = video_list_ul.find_all('li', class_='f_l')
|
||||
for li in lis:
|
||||
a = li.find('a', class_='video')
|
||||
if a:
|
||||
href = urljoin(url, a.get('href'))
|
||||
img = a.find('img')
|
||||
img_src = urljoin(url, img.get('src')) if img else ""
|
||||
title_span = a.find('span', class_='video_title')
|
||||
title = title_span.get_text(strip=True) if title_span else ""
|
||||
|
||||
all_items.append({
|
||||
'title': title,
|
||||
'url': href,
|
||||
'cover_image': img_src,
|
||||
'summary': '',
|
||||
'category': 'godkitchen'
|
||||
})
|
||||
|
||||
next_link = current_soup.find('a', string=re.compile(r'下一页|Next'))
|
||||
if not next_link:
|
||||
break
|
||||
next_href = next_link.get('href')
|
||||
if not next_href or next_href == '#':
|
||||
break
|
||||
next_url = urljoin(url, next_href)
|
||||
log(f" Fetching next page: {next_url}")
|
||||
current_soup = get_soup(next_url)
|
||||
if not current_soup:
|
||||
break
|
||||
page_count += 1
|
||||
if page_count > 20:
|
||||
break
|
||||
|
||||
log(f"Total Recipes to scrape: {len(all_items)}")
|
||||
|
||||
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
||||
futures = [executor.submit(process_item, item, 'recipe', 'v2_recipes') for item in all_items]
|
||||
for _ in as_completed(futures):
|
||||
pass
|
||||
|
||||
def task5_community():
|
||||
log("Starting Task 5: Community Posts")
|
||||
# Source: Wiki, items 200-500
|
||||
# Page 21 starts at item 201 (assuming 10 per page)
|
||||
task = {
|
||||
'name': 'community_wiki',
|
||||
'url': 'http://www.ishen365.com/index.php/wiki',
|
||||
'type': 'article', # not used
|
||||
'table': 'v2_community_posts',
|
||||
'limit': 300,
|
||||
'start_page': 21
|
||||
}
|
||||
|
||||
items = scrape_list_items(task)
|
||||
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
||||
futures = [executor.submit(process_item, item, 'article', 'v2_community_posts') for item in items]
|
||||
for _ in as_completed(futures):
|
||||
pass
|
||||
|
||||
def main():
|
||||
# Initialize output file
|
||||
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
|
||||
f.write("-- Bulk Insert SQL for Knowledge, Recipes, and Community\n")
|
||||
f.write("DELETE FROM `v2_knowledge`;\n")
|
||||
f.write("DELETE FROM `v2_recipes`;\n")
|
||||
f.write("DELETE FROM `v2_community_posts`;\n")
|
||||
|
||||
task2_nutrients()
|
||||
task3_articles_guides()
|
||||
task4_recipes()
|
||||
task5_community()
|
||||
|
||||
log("All tasks completed!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
667
msh_crmeb_22/scraper/site_content.html
Normal file
667
msh_crmeb_22/scraper/site_content.html
Normal file
@@ -0,0 +1,667 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
<meta content="食物营养成分查询,肾病食物,肾病食品" name="keywords"/>
|
||||
<meta content="肾病能吃什么,爱肾医疗食物营养成分查询,么,让肾友为吃不再发愁。" name="description"/>
|
||||
<!-- CSRF Token -->
|
||||
<meta content="6NaY5UfrTSHL8jskDwoUf3JCTFX8fP4s7u4ey6uX" name="csrf-token"/>
|
||||
<title>
|
||||
食物营养成分查询,肾病食物,肾病可以吃什么-爱肾医疗
|
||||
</title>
|
||||
<link href="http://www.ishen365.com/pc/css/amazeui.min.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/layui/css/layui.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/header.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/footer.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/yyk.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/love_food.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/pc/css/base.css" rel="stylesheet"/>
|
||||
<link href="http://www.ishen365.com/css/sweetalert.css" rel="stylesheet"/>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?2e8a6213f9d88cbcd3e059cf457b5e51";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- GrowingIO Analytics code version 2.1 -->
|
||||
<!-- Copyright 2015-2018 GrowingIO, Inc. More info available at http://www.growingio.com -->
|
||||
<script type="text/javascript">
|
||||
!function(e,t,n,g,i){e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},n=t.createElement("script"),tag=t.getElementsByTagName("script")[0],n.async=1,n.src=('https:'==document.location.protocol?'https://':'http://')+g,tag.parentNode.insertBefore(n,tag)}(window,document,"script","assets.growingio.com/2.1/gio.js","gio");
|
||||
gio('init','9b91df50a16b0142', {});
|
||||
|
||||
//custom page code begin here
|
||||
|
||||
//custom page code end here
|
||||
|
||||
gio('send');
|
||||
</script>
|
||||
<!-- End GrowingIO Analytics code version: 2.1 -->
|
||||
<!-- End GrowingIO Analytics code version: 2.1 -->
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.ishen365.com/pc/js/jquery-2.2.4.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/pc/layui/layui.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/pc/js/amazeui.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/pc/js/header.js" type="text/javascript">
|
||||
</script>
|
||||
<div class="header_bg">
|
||||
<div class="top1">
|
||||
<div class="top1_center fix">
|
||||
<a class="reg" href="http://www.ishen365.com/register" id="reg">
|
||||
注册
|
||||
</a>
|
||||
<a class="login" href="http://www.ishen365.com/login" id="login">
|
||||
登录
|
||||
</a>
|
||||
<input id="as_uid" type="hidden" value="0"/>
|
||||
<input id="as_login_url" type="hidden" value="http://www.ishen365.com/index.php/login"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="top2">
|
||||
<img class="top_logo" src="http://www.ishen365.com/pc/images/logo.png"/>
|
||||
<div class="search">
|
||||
<form action="http://www.ishen365.com/index.php/wiki" class="" id="header_form" method="get">
|
||||
<div class="search_ct">
|
||||
<i class="search_ico">
|
||||
</i>
|
||||
<input class="search_ipt" id="top_search_ipt" name="keywords" placeholder="请输入你想要搜索的关键词" type="text">
|
||||
<span class="search_btn btn" id="head_sosuo">
|
||||
搜索
|
||||
</span>
|
||||
</input>
|
||||
</div>
|
||||
<div class="search_tip">
|
||||
关键词:
|
||||
<span class="to_search">
|
||||
肾病
|
||||
</span>
|
||||
<span class="to_search">
|
||||
慢性病
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$("#head_sosuo").on('click',function()
|
||||
{
|
||||
$("#header_form").submit()
|
||||
});
|
||||
$(".to_search").click(function(){
|
||||
$("#top_search_ipt").val($(this).html())
|
||||
$("#header_form").submit()
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav_bg">
|
||||
<div class="navbar">
|
||||
<ul class="layui-nav" lay-filter="">
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_none" href="http://www.ishen365.com/index.php">
|
||||
首页
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_none" href="http://www.aishenhospital.com" target="_blank">
|
||||
互联网医院
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_txzx" href="">
|
||||
连锁肾病医院
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_yszq" href="http://www.ishen365.com/index.php/doctor">
|
||||
医生专区
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_hzzq" href="http://www.ishen365.com/index.php/patient">
|
||||
肾友专区
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_yyzx" href="">
|
||||
营养学院
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="has_down" data-id="down_none" href="http://www.ishen365.com/shop">
|
||||
爱肾商城
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<script type="text/javascript">
|
||||
//注意:导航 依赖 element 模块,否则无法进行功能性操作
|
||||
layui.use('element', function () {
|
||||
var element = layui.element();
|
||||
|
||||
//…
|
||||
});
|
||||
layui.use('layer', function () {
|
||||
var layer = layui.layer;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div class="down_menu" id="down_txzx">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
连锁肾病医院
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365haikou.com" target="_blank">
|
||||
海口爱肾肾脏病医院
|
||||
</a>
|
||||
<a href="http://lanzhou.ishen365.com" target="_blank">
|
||||
兰州爱肾血液透析中心
|
||||
</a>
|
||||
<a href="#">
|
||||
三亚爱肾透析中心(建设中)
|
||||
</a>
|
||||
<a href="http://chongqing.ishen365.com" target="_blank">
|
||||
重庆爱肾文心医院
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="down_none">
|
||||
</div>
|
||||
<div class="down_menu" id="down_yszq">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
医生专区
|
||||
<br/>
|
||||
<span style="font-size:16px;">
|
||||
仅供教学科研使用
|
||||
</span>
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/wiki">
|
||||
爱肾百科
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/doctornews">
|
||||
肾科资讯
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/tool/mdrd">
|
||||
临床工具
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="down_menu" id="down_hzzq">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
肾友专区
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<!--a href="http://www.ishen365.com/index.php/article/patientnews">肾科资讯</a-->
|
||||
<a href="http://www.ishen365.com/index.php/article/ishenkj">
|
||||
名医讲堂
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/scienceteach">
|
||||
科普宣教
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/ask/doctor">
|
||||
问医生
|
||||
</a>
|
||||
</div>
|
||||
<!--div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/ask/doctor">问医生</a>
|
||||
</div-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="down_menu" id="down_yyzx">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
营养学院
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/article/godkitchen">
|
||||
名医神厨
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/rsyys">
|
||||
认识营养素
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/swcfb">
|
||||
食物成分表
|
||||
</a>
|
||||
</div>
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/ask/dietitian">
|
||||
问营养师
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/tool/nutrition">
|
||||
食谱计算器
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--main content start-->
|
||||
<div class="c_center fix" style="margin-top: 190px;">
|
||||
<div class="content6 f_l" style="width:725px;">
|
||||
<div class="content6_left f_l">
|
||||
<div class="content6_left_bottom" style="margin-top:0">
|
||||
<div class="sub_title fix">
|
||||
<img alt="" class="f_l" src="http://www.ishen365.com/pc/images/swcfb.png"/>
|
||||
<span class="f_l">
|
||||
食物成分表
|
||||
</span>
|
||||
<img alt="" class="f_l arrow" src="http://www.ishen365.com/pc/images/arrow.png"/>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/cereal">
|
||||
<div class="tianchong">
|
||||
谷类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/beans">
|
||||
<div class="tianchong">
|
||||
豆类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/starch">
|
||||
<div class="tianchong">
|
||||
薯类与淀粉类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/vegetables">
|
||||
<div class="tianchong">
|
||||
蔬菜类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/fungi">
|
||||
<div class="tianchong">
|
||||
菌藻类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/fruit">
|
||||
<div class="tianchong">
|
||||
水果类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/nuts">
|
||||
<div class="tianchong">
|
||||
坚果种子类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/meat">
|
||||
<div class="tianchong">
|
||||
禽肉类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/neat">
|
||||
<div class="tianchong">
|
||||
畜肉类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/milk">
|
||||
<div class="tianchong">
|
||||
乳制品类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/egg">
|
||||
<div class="tianchong">
|
||||
蛋类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/fash">
|
||||
<div class="tianchong">
|
||||
水产类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/snack">
|
||||
<div class="tianchong">
|
||||
小吃类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/drink">
|
||||
<div class="tianchong">
|
||||
饮料类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/alcohol">
|
||||
<div class="tianchong">
|
||||
含酒精饮料
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/sugar">
|
||||
<div class="tianchong">
|
||||
糖蜜饯类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/oil">
|
||||
<div class="tianchong">
|
||||
油脂类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/Condiments">
|
||||
<div class="tianchong">
|
||||
调味品类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/baby">
|
||||
<div class="tianchong">
|
||||
婴儿类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/fastfood">
|
||||
<div class="tianchong">
|
||||
速食类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="http://www.ishen365.com/index.php/article/foodtwo">
|
||||
<div class="tianchong">
|
||||
药食两用类
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<link href="http://www.ishen365.com/pc/css/news_center.css" rel="stylesheet">
|
||||
<div class="f_l">
|
||||
<div class="fix" id="news_center">
|
||||
<div class="content5_right f_l">
|
||||
<div class="content5_right_top">
|
||||
<b class="subtitle">
|
||||
科普宣教
|
||||
</b>
|
||||
<a href="http://www.ishen365.com/index.php/article/scienceteach">
|
||||
<div class="more f_r">
|
||||
更多
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="content5_right_list m_t10 fix">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4330">
|
||||
<img class="f_l" src="http://www.ishen365.com/index.php/aetherupload/display/images/201910/c4936b798f3acf68d9264f8af396fcb6.png">
|
||||
</img>
|
||||
</a>
|
||||
<div class="f_l content5_right_text">
|
||||
<div class="content5_right_subtitle">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4330">
|
||||
得了肾病啥也不能吃?这份肾病饮食大全,帮你延缓尿毒症
|
||||
</a>
|
||||
</div>
|
||||
<div class="content5_right_description">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4330">
|
||||
收藏,转发给需要的朋友
|
||||
<span>
|
||||
[详情]
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content5_right_list m_t10 fix">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4329">
|
||||
<img class="f_l" src="http://www.ishen365.com/index.php/aetherupload/display/images/201909/7d96c51d7e3eb6853417ab19685ae0b8.png">
|
||||
</img>
|
||||
</a>
|
||||
<div class="f_l content5_right_text">
|
||||
<div class="content5_right_subtitle">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4329">
|
||||
肾衰可能是这3个喝水习惯引起的!正确喝水技巧送给你!
|
||||
</a>
|
||||
</div>
|
||||
<div class="content5_right_description">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4329">
|
||||
快转给“不会喝水的人”
|
||||
<span>
|
||||
[详情]
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content5_right_list m_t10 fix">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4328">
|
||||
<img class="f_l" src="http://www.ishen365.com/index.php/aetherupload/display/images/201912/847dbe6e09dcb2c6fb31be29c6aa44de.png"/>
|
||||
</a>
|
||||
<div class="f_l content5_right_text">
|
||||
<div class="content5_right_subtitle">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4328">
|
||||
牛羊肉伤肾,海鲜是“发物”?肾不好,到底不能吃哪些肉?
|
||||
</a>
|
||||
</div>
|
||||
<div class="content5_right_description">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4328">
|
||||
别纠结,看这篇文章就对了
|
||||
<span>
|
||||
[详情]
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content5_right_list m_t10 fix">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4327">
|
||||
<img class="f_l" src="http://www.ishen365.com/index.php/aetherupload/display/images/201912/a2aa1e3da6a337325558f58eedb1a79c.png"/>
|
||||
</a>
|
||||
<div class="f_l content5_right_text">
|
||||
<div class="content5_right_subtitle">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4327">
|
||||
肾病,到底要不要忌辛辣
|
||||
</a>
|
||||
</div>
|
||||
<div class="content5_right_description">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4327">
|
||||
让人无处安放的辣椒香~
|
||||
<span>
|
||||
[详情]
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content5_right_list m_t10 fix">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4326">
|
||||
<img class="f_l" src="http://www.ishen365.com/index.php/aetherupload/display/images/201911/147d726d767fbe32b93d6be3149ed87a.png"/>
|
||||
</a>
|
||||
<div class="f_l content5_right_text">
|
||||
<div class="content5_right_subtitle">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4326">
|
||||
肾病时间越长,这种疾病的发生风险就越高?血透肾友尤其需要注意!
|
||||
</a>
|
||||
</div>
|
||||
<div class="content5_right_description">
|
||||
<a href="http://www.ishen365.com/index.php/article/10/show/4326">
|
||||
终末期肾脏疾病透析患者肾性骨病的发病率几
|
||||
<span>
|
||||
[详情]
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="love_food">
|
||||
<div class="content6_right f_l">
|
||||
<div class="content6_right_top">
|
||||
<b class="subtitle">
|
||||
爱肾特食
|
||||
</b>
|
||||
<a href="http://www.ishen365.com/shop" target="_blank">
|
||||
<div class="more f_r">
|
||||
更多
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<a href="http://www.ishen365.com/shop" target="_blank">
|
||||
<div class="content6_right_add">
|
||||
<img src="http://www.ishen365.com/pc/images/dami.jpg"/>
|
||||
<div>
|
||||
低蛋白米
|
||||
</div>
|
||||
<div class="content6_right_description">
|
||||
低蛋白,低钾,低磷
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/shop">
|
||||
<div class="content6_right_add">
|
||||
<img src="http://www.ishen365.com/pc/images/trzzm.jpg"/>
|
||||
<div>
|
||||
低蛋白天然种植米套餐
|
||||
</div>
|
||||
<div class="content6_right_description">
|
||||
天然种植,口感接近真实大米,适合长期食用
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</link>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="ishen_logo">
|
||||
<img alt="" src="http://www.ishen365.com/pc/images/ishen_logo.png"/>
|
||||
</div>
|
||||
<div class="foot">
|
||||
<div class="foot_nav">
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/article/60/show/3321">
|
||||
关于爱肾
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/join">
|
||||
加入我们
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/article/60/show/3323">
|
||||
联系我们
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/article/60/show/3324">
|
||||
版权声明
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.ishen365.com/personal">
|
||||
个人中心
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://www.aishenhospital.com" target="_blank">
|
||||
爱肾云医院
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
Copyright 2018上海艾力彼信息科技有限责任公司.
|
||||
<a href="http://www.beian.miit.gov.cn">
|
||||
沪ICP备14035697号-1
|
||||
</a>
|
||||
沪卫(中医)网审[2014]第10246号 互联网药品信息服务资格证书(沪)-经营性-2017-0012
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="go_top">
|
||||
<a href="javascript:scrollTo(0,0);">
|
||||
<img alt="" src="http://www.ishen365.com/pc/images/scroll_top.png"/>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
var DEFAULT_VERSION = "8.0";
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var isIE = ua.indexOf("msie")>-1;
|
||||
var safariVersion;
|
||||
if(isIE){
|
||||
safariVersion = ua.match(/msie ([\d.]+)/)[1];
|
||||
//alert(safariVersion)
|
||||
if(safariVersion <= DEFAULT_VERSION ){
|
||||
// 跳转至页面1
|
||||
window.location.href="http://www.ishen365.com/index.php/unsupport"
|
||||
}else{
|
||||
// 跳转至页面2
|
||||
}
|
||||
}else{
|
||||
// 跳转至页面2
|
||||
}
|
||||
</script>
|
||||
</footer>
|
||||
<!--main content end-->
|
||||
<script src="http://www.ishen365.com/js/sweetalert.min.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
460
msh_crmeb_22/scraper/source_recipe_detail.html
Normal file
460
msh_crmeb_22/scraper/source_recipe_detail.html
Normal file
@@ -0,0 +1,460 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="黑木耳炒山药,">
|
||||
<meta name="description" content="适宜人群:慢性肾脏病、高血压性肾病、糖尿病肾病、尿酸性肾病等。">
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="NdWPYME9zMHQjs0BQagXHQzWVGg63HPaOk91KL8o">
|
||||
<title>名医神厨-黑木耳炒山药</title>
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/css/amazeui.min.css"/>
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/layui/css/layui.css"/>
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/css/header.css"/>
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/css/footer.css"/>
|
||||
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/css/essay.css"/>
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/css/video_play.css" />
|
||||
<link rel="stylesheet" href="http://www.ishen365.com/pc/css/base.css"/>
|
||||
<link href="http://www.ishen365.com/css/sweetalert.css" rel="stylesheet">
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?2e8a6213f9d88cbcd3e059cf457b5e51";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- GrowingIO Analytics code version 2.1 -->
|
||||
<!-- Copyright 2015-2018 GrowingIO, Inc. More info available at http://www.growingio.com -->
|
||||
|
||||
<script type='text/javascript'>
|
||||
!function(e,t,n,g,i){e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},n=t.createElement("script"),tag=t.getElementsByTagName("script")[0],n.async=1,n.src=('https:'==document.location.protocol?'https://':'http://')+g,tag.parentNode.insertBefore(n,tag)}(window,document,"script","assets.growingio.com/2.1/gio.js","gio");
|
||||
gio('init','9b91df50a16b0142', {});
|
||||
|
||||
//custom page code begin here
|
||||
|
||||
//custom page code end here
|
||||
|
||||
gio('send');
|
||||
|
||||
</script>
|
||||
|
||||
<!-- End GrowingIO Analytics code version: 2.1 -->
|
||||
|
||||
|
||||
<!-- End GrowingIO Analytics code version: 2.1 -->
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="http://www.ishen365.com/pc/js/jquery-2.2.4.min.js"></script>
|
||||
<script type="text/javascript" src="http://www.ishen365.com/pc/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="http://www.ishen365.com/pc/js/amazeui.min.js"></script>
|
||||
<script type="text/javascript" src="http://www.ishen365.com/pc/js/header.js"></script>
|
||||
<div class="header_bg">
|
||||
<div class="top1">
|
||||
<div class="top1_center fix">
|
||||
<a href="http://www.ishen365.com/register" class="reg" id="reg">注册</a>
|
||||
<a href="http://www.ishen365.com/login" class="login" id="login">登录</a>
|
||||
<input type="hidden" id="as_uid" value="0">
|
||||
<input type="hidden" id="as_login_url" value="http://www.ishen365.com/index.php/login">
|
||||
</div>
|
||||
</div>
|
||||
<div class="top2">
|
||||
<img class="top_logo" src="http://www.ishen365.com/pc/images/logo.png"/>
|
||||
<div class="search">
|
||||
<form action="http://www.ishen365.com/index.php/wiki" class="" method="get" id="header_form">
|
||||
<div class="search_ct">
|
||||
<i class="search_ico"></i>
|
||||
<input class="search_ipt" type="text" placeholder="请输入你想要搜索的关键词" id="top_search_ipt" name="keywords"/>
|
||||
<span class="search_btn btn" id="head_sosuo">搜索</span>
|
||||
</div>
|
||||
<div class="search_tip">关键词:<span class="to_search">肾病</span><span class="to_search">慢性病</span></div>
|
||||
</form>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
$("#head_sosuo").on('click',function()
|
||||
{
|
||||
$("#header_form").submit()
|
||||
});
|
||||
$(".to_search").click(function(){
|
||||
$("#top_search_ipt").val($(this).html())
|
||||
$("#header_form").submit()
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="nav_bg">
|
||||
<div class="navbar">
|
||||
<ul class="layui-nav" lay-filter="">
|
||||
<li class="layui-nav-item"><a class="has_down" data-id="down_none" href="http://www.ishen365.com/index.php">首页</a></li>
|
||||
<li class="layui-nav-item"><a class="has_down" data-id="down_none" href="http://www.aishenhospital.com" target="_blank">互联网医院</a></li>
|
||||
<li class="layui-nav-item"><a href="http://www.ishen365.com/index.php"class="has_down" data-id="down_txzx" href="">连锁肾病医院</a></li>
|
||||
<li class="layui-nav-item"><a class="has_down" data-id="down_yszq" href="http://www.ishen365.com/index.php/doctor">医生专区</a></li>
|
||||
<li class="layui-nav-item"><a class="has_down" data-id="down_hzzq" href="http://www.ishen365.com/index.php/patient">肾友专区</a></li>
|
||||
<li class="layui-nav-item"><a href="http://www.ishen365.com/index.php/sfsn" class="has_down" data-id="down_yyzx" href="">营养学院</a></li>
|
||||
<li class="layui-nav-item"><a class="has_down" data-id="down_none" href="http://www.ishen365.com/shop">爱肾商城</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
//注意:导航 依赖 element 模块,否则无法进行功能性操作
|
||||
layui.use('element', function () {
|
||||
var element = layui.element();
|
||||
|
||||
//…
|
||||
});
|
||||
layui.use('layer', function () {
|
||||
var layer = layui.layer;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="down_txzx" class="down_menu">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
连锁肾病医院
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365haikou.com" target="_blank">海口爱肾肾脏病医院</a>
|
||||
<a href="http://lanzhou.ishen365.com" target="_blank">兰州爱肾血液透析中心</a>
|
||||
<a href="#">三亚爱肾透析中心(建设中)</a>
|
||||
<a href="http://chongqing.ishen365.com" target="_blank">重庆爱肾文心医院</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="down_none">
|
||||
</div>
|
||||
<div id="down_yszq" class="down_menu">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
医生专区<br><span style="font-size:16px;">仅供教学科研使用</span>
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/wiki">爱肾百科</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/doctornews">肾科资讯</a>
|
||||
<a href="http://www.ishen365.com/index.php/tool/mdrd">临床工具</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="down_hzzq" class="down_menu">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
肾友专区
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<!--a href="http://www.ishen365.com/index.php/article/patientnews">肾科资讯</a-->
|
||||
<a href="http://www.ishen365.com/index.php/article/ishenkj">名医讲堂</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/scienceteach">科普宣教</a>
|
||||
<a href="http://www.ishen365.com/index.php/ask/doctor">问医生</a>
|
||||
</div>
|
||||
<!--div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/ask/doctor">问医生</a>
|
||||
</div-->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="down_yyzx" class="down_menu">
|
||||
<div class="down_menu_center fix">
|
||||
<div class="down_menu_tit">
|
||||
营养学院
|
||||
</div>
|
||||
<div class="down_menu_list fix">
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/article/godkitchen">名医神厨</a>
|
||||
|
||||
<a href="http://www.ishen365.com/index.php/rsyys">认识营养素</a>
|
||||
<a href="http://www.ishen365.com/index.php/swcfb">食物成分表</a>
|
||||
</div>
|
||||
<div class="down_list1">
|
||||
<a href="http://www.ishen365.com/index.php/ask/dietitian">问营养师</a>
|
||||
<a href="http://www.ishen365.com/index.php/tool/nutrition">食谱计算器</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--main content start-->
|
||||
<div class="c_center fix" style="margin-top: 190px;">
|
||||
<div class="content_left">
|
||||
<div class="tit">黑木耳炒山药</div>
|
||||
<div class="tit2">
|
||||
<input type="hidden" name="_token" value="NdWPYME9zMHQjs0BQagXHQzWVGg63HPaOk91KL8o">
|
||||
<div class="time">发布时间:2017-01-19 11:29:38</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div id="a1" class="video_play" style="background-color: rgb(0, 0, 0); width: 700px; height: 500px; cursor: pointer;"><video controls="controls" src="http://ishen.oss-cn-hangzhou.aliyuncs.com/Act-ss-mp4-sd/742f6a32b5674ece85871ae4f23e842b/%E5%90%8D%E5%8C%BB%E7%A5%9E%E5%8E%A8%20%E9%BB%91%E6%9C%A8%E8%80%B3%E7%82%92%E5%B1%B1%E8%8D%AF.mp4" id="ckplayer_a1" width="700" height="500" loop="loop" poster=" /aetherupload/display/uploadfile/2017/0516/20170516095211297.png" webkit-playsinline=""></video></div>
|
||||
<script type="text/javascript">
|
||||
var flashvars={
|
||||
p:0,
|
||||
e:1,
|
||||
i:'/aetherupload/display/uploadfile/2017/0516/20170516095211297.png'
|
||||
};
|
||||
var video=['http://ishen.oss-cn-hangzhou.aliyuncs.com/Act-ss-mp4-sd/742f6a32b5674ece85871ae4f23e842b/%E5%90%8D%E5%8C%BB%E7%A5%9E%E5%8E%A8%20%E9%BB%91%E6%9C%A8%E8%80%B3%E7%82%92%E5%B1%B1%E8%8D%AF.mp4'];
|
||||
var support=['all'];
|
||||
CKobject.embedHTML5('a1','ckplayer_a1',700,500,video,flashvars,support);
|
||||
</script>
|
||||
<p class="MsoListParagraph" style="margin-left:24px;text-indent:0;">
|
||||
<span style="font-family:宋体;">黑木耳炒山药是一道补益脾肾的良菜,对慢性肾病、高血压肾病、糖尿病肾病、尿酸性肾病等有辅助治疗作用。</span>
|
||||
</p>
|
||||
<p style="text-indent:24px;">
|
||||
<span style="font-family:宋体;">功效及适宜人群:</span>
|
||||
</p>
|
||||
<p class="MsoListParagraph" style="margin-left:24px;text-indent:0;">
|
||||
<span style="font-family:宋体;">对慢性肾脏病、高血压性肾病、糖尿病肾病、尿酸性肾病等。均有良好的辅助治疗作用。</span>
|
||||
</p>
|
||||
<p style="text-indent:24px;">
|
||||
<span style="font-family:宋体;">能预防和治疗高血压、冠心病等多种血管病变。</span>
|
||||
</p> </div>
|
||||
<div class="lst_btns fix">
|
||||
<div class="see" id="reading">
|
||||
7521
|
||||
</div>
|
||||
<div class="support" id="top">
|
||||
0
|
||||
</div>
|
||||
<div class="tread" id="tread">
|
||||
0
|
||||
</div>
|
||||
<div class="fav" id="collection">
|
||||
0
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="c_right">
|
||||
<style type="text/css">
|
||||
/*右边样式二*/
|
||||
.right_2{
|
||||
width:255px;
|
||||
}
|
||||
.r2_tit{
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
text-indent:10px;
|
||||
background-color:#f4f5f7;
|
||||
border-bottom:1px solid #bfd8bb;
|
||||
}
|
||||
|
||||
.r2_tit a{
|
||||
line-height:45px;
|
||||
}
|
||||
.r2_txt{
|
||||
padding:20px;
|
||||
|
||||
}
|
||||
.r2_li{
|
||||
width:96px;
|
||||
overflow:hidden;
|
||||
margin-bottom:12px;
|
||||
cursor:pointer;
|
||||
|
||||
}
|
||||
.r2_li:nth-child(odd){
|
||||
margin-right:18px;
|
||||
}
|
||||
.li2_img{
|
||||
width:96px;
|
||||
height:85px;
|
||||
background-repeat:no-repeat;
|
||||
background-size:100% auto;
|
||||
overflow:hidden;
|
||||
}
|
||||
.li2_tit{
|
||||
width:96px;
|
||||
overflow:hidden;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="right_2 f_l bor1 ">
|
||||
<div class="r2_tit f_s16">
|
||||
名医神厨
|
||||
<a href="http://www.ishen365.com/index.php/article/godkitchen" class="to_all f_r f_s14 m_r20">查看全部</a>
|
||||
</div>
|
||||
<div class="r2_txt f_s14 fix">
|
||||
<a href="http://www.ishen365.com/index.php/article/18/show/37" target="_blank" class="r2_li f_l">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095441919.png')"></div>
|
||||
<div class="li2_tit">肉末烧冬瓜</div>
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/18/show/36" target="_blank" class="r2_li f_l">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095426644.png')"></div>
|
||||
<div class="li2_tit">西红柿鸡蛋捞面</div>
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/18/show/35" target="_blank" class="r2_li f_l">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095409875.png')"></div>
|
||||
<div class="li2_tit">红烧鲫鱼</div>
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/18/show/34" target="_blank" class="r2_li f_l">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095352322.png')"></div>
|
||||
<div class="li2_tit">清炖牛肉萝卜汤</div>
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/18/show/33" target="_blank" class="r2_li f_l">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095336792.png')"></div>
|
||||
<div class="li2_tit">翡翠虾仁珍珠面</div>
|
||||
</a>
|
||||
<a href="http://www.ishen365.com/index.php/article/18/show/32" target="_blank" class="r2_li f_l">
|
||||
<div class="li2_img" style="background-image:url('http://www.ishen365.com/index.php/aetherupload/display/uploadfile/2017/0516/20170516095315544.png')"></div>
|
||||
<div class="li2_tit">蒜蓉粉丝蒸大虾</div>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div> </div>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="ishen_logo">
|
||||
<img src="http://www.ishen365.com/pc/images/ishen_logo.png" alt="">
|
||||
</div>
|
||||
<div class="foot">
|
||||
<div class="foot_nav">
|
||||
<div><a href="http://www.ishen365.com/article/60/show/3321">关于爱肾</a></div>
|
||||
<div><a href="http://www.ishen365.com/join">加入我们</a></div>
|
||||
<div><a href="http://www.ishen365.com/article/60/show/3323">联系我们</a></div>
|
||||
<div><a href="http://www.ishen365.com/article/60/show/3324">版权声明</a></div>
|
||||
<div><a href="http://www.ishen365.com/personal">个人中心</a></div>
|
||||
<div><a href="http://www.aishenhospital.com" target="_blank">爱肾云医院</a></div>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
Copyright 2018上海艾力彼信息科技有限责任公司. <a href="http://www.beian.miit.gov.cn">沪ICP备14035697号-1</a> 沪卫(中医)网审[2014]第10246号 互联网药品信息服务资格证书(沪)-经营性-2017-0012
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="go_top">
|
||||
<a href="javascript:scrollTo(0,0);"><img src="http://www.ishen365.com/pc/images/scroll_top.png" alt=""></a>
|
||||
</div>
|
||||
<script>
|
||||
var DEFAULT_VERSION = "8.0";
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var isIE = ua.indexOf("msie")>-1;
|
||||
var safariVersion;
|
||||
if(isIE){
|
||||
safariVersion = ua.match(/msie ([\d.]+)/)[1];
|
||||
//alert(safariVersion)
|
||||
if(safariVersion <= DEFAULT_VERSION ){
|
||||
// 跳转至页面1
|
||||
window.location.href="http://www.ishen365.com/index.php/unsupport"
|
||||
}else{
|
||||
// 跳转至页面2
|
||||
}
|
||||
}else{
|
||||
// 跳转至页面2
|
||||
}</script>
|
||||
</footer><!--main content end-->
|
||||
|
||||
<script type="text/javascript" src="http://www.ishen365.com/pc/js/ckplayer.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
window.onload=function () {
|
||||
|
||||
if("0" == 1){
|
||||
$(".support").addClass("support_active")
|
||||
}
|
||||
if("0" == 1){
|
||||
$(".tread").addClass("tread_active")
|
||||
}
|
||||
if("0" == 1){
|
||||
$(".fav").addClass("fav_active")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(".lst_btns").on("click",".share",function(){
|
||||
$(".bshare-custom").toggle();
|
||||
|
||||
});
|
||||
$("#top").on('click',function()
|
||||
{
|
||||
//顶
|
||||
toLogin();
|
||||
$.ajax({
|
||||
url:"http://www.ishen365.com/index.php/article/top",
|
||||
type:"POST",
|
||||
dataType: "json",
|
||||
data:{
|
||||
_token:$("input[name='_token']").val(),
|
||||
id:"28",
|
||||
catid:"18",
|
||||
type:"top"
|
||||
},
|
||||
success:function(data){
|
||||
$("#top").html(data.date);
|
||||
if(data.state == 'bright'){
|
||||
$(".support").addClass("support_active");
|
||||
}else if(data.state == 'dark'){
|
||||
$(".support").removeClass("support_active");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
//踩
|
||||
$("#tread").on('click',function(){
|
||||
toLogin();
|
||||
$.ajax({
|
||||
url:"http://www.ishen365.com/index.php/article/tread",
|
||||
type:"POST",
|
||||
dataType: "json",
|
||||
data:{
|
||||
_token:$("input[name='_token']").val(),
|
||||
id:"28",
|
||||
catid:"18",
|
||||
type:"tread"
|
||||
},
|
||||
success:function(data){
|
||||
$("#tread").html(data.date);
|
||||
if(data.state == 'bright'){
|
||||
$(".tread").addClass("tread_active");
|
||||
}else if(data.state == 'dark'){
|
||||
$(".tread").removeClass("tread_active");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
//收藏
|
||||
$("#collection").on('click',function()
|
||||
{
|
||||
toLogin();
|
||||
$.ajax({
|
||||
url:"http://www.ishen365.com/index.php/article/collection",
|
||||
type:"POST",
|
||||
dataType: "json",
|
||||
data:{
|
||||
_token:$("input[name='_token']").val(),
|
||||
id:"28",
|
||||
catid:"18",
|
||||
type:"collection"
|
||||
},
|
||||
success:function(data){
|
||||
$("#collection").html(data.date);
|
||||
if(data.state == 'bright'){
|
||||
$(".fav").addClass("fav_active");
|
||||
}else if(data.state == 'dark'){
|
||||
$(".fav").removeClass("fav_active");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<script src="http://www.ishen365.com/js/sweetalert.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user