找回密码
 立即注册

QQ登录

只需一步,快速开始

tominson

银牌会员

89

主题

368

帖子

2183

积分

银牌会员

积分
2183
tominson
银牌会员   /  发表于:2024-3-13 09:07  /   查看:741  /  回复:9
20金币
怎样对一段富文本的内容,通过服务端命令或者JS来获取文本中的表格内容,再写入到数据库表中


如下文的内容:

<html><body><p>        </p><ol> 2023-01-31 11:26 编辑:管理员<div>    <ul title=""打印""window.print()""> </ul>    <ul></ul>    <ul><span data-cmd=""weixin"" title=""分享到微信""></span><span data-cmd=""sqq"" title=""分享到QQ好友""></span><span data-cmd=""qzone"" title=""分享到QQ空间""></span><span data-cmd=""tsina"" title=""分享到新浪微博""></span><span data-cmd=""more""></span></ul>   </div></ol>    <ol> </ol>        <ol l=""nr""><p><strong>一、项目编号:</strong>QZZC2022-G1-00013-CGZX</p><p><strong>二、项目名称:</strong>钦北区义务教育薄弱环节改善与能力提升资金 计算机采购</p><p><strong>三、中标(成交)信息</strong>         </p><p>1.中标结果:</p><table><tbody><tr><td><p><strong>序号</strong></p></td><td><p><strong>中标(成交)金额(元)</strong></p></td><td><p><strong>中标供应商名称</strong></p></td><td><p><strong>中标供应商地址</strong></p></td></tr><tr><td><p>1</p></td><td><p>报价:2760000(元)</p></td><td><p>广西港联电子科技有限公司</p></td><td><p>广西钦州市育才路79号</p></td></tr></tbody></table><p><strong>四、主要标的信息</strong>         </p><p>货物类主要标的信息:  </p><p></p><table><tbody><tr><td><p>序号</p></td><td><p>标项名称</p></td><td><p>标的名称</p></td><td><p>品牌</p></td><td><p>数量</p></td><td><p>单价(元)</p></td><td><p>规格型号</p></td></tr><tr><td><p>1</p></td><td><p>钦北区义务教育薄弱环节改善与能力提升资金 计算机采购</p></td><td><p>商用计算机</p></td><td><p>宏碁</p></td><td><p>800</p></td><td><p>3450</p></td><td><p>Acer Veriton A850,详见报价明细表</p></td></tr></tbody></table><p></p><p><strong>五、评审专家(单一来源采购人员)名单:</strong>         </p><p>冯华玉,邹彬,韦斌,檀大耀,黄广恳(采购人代表)          </p><p><strong>六、代理服务收费标准及金额:</strong>      </p><p>1.代理服务收费标准:按钦州市物价局“钦市价费[2013]4号”文件,以差额定率累进法计算。成交供应商须按成交金额缴纳相应的代理服务费。          </p><p>2.代理服务收费金额(元):27488</p><p><strong>七、公告期限</strong>         </p><p>自本公告发布之日起1个工作日。          </p><p><strong>八、其他补充事宜</strong><strong>:无</strong>                  </p><p><strong>九、对本次公告内容提出询问,请按以下方式联系</strong>      </p><p>1.采购人信息    </p><p>名 称:钦州市钦北区教育局    </p><p>地 址:钦州市政通街2号   </p><p>联系方式:0777-3686166  </p><p>2.采购代理机构信息    </p><p>名 称:钦州市政府采购中心    </p><p>地 址:金海湾大道8号政务服务中心   </p><p>联系方式:0777-2886006   </p><p>3.项目联系方式</p><p>项目联系人:莫丹丹</p><p>电 话:0777-2886006</p><p>附件:<img src=""/img/icon_doc.gif""><a href=""/uploadfile/file/67ae3b47de809b3ea1910a9312a73d42.doc"" title=""附件2.doc"">附件2.doc</a></p><p><img src=""/img/icon_pdf.gif""jspwh(this)""><a href=""/uploadfile/file/5b4e0bb05922406dc594606dc88f3201.pdf"" title=""附件1.pdf"">附件1.pdf</a></p><p></p><p>钦州市政府采购中心</p><p>2023年1月31日</p><p><br></p></ol>     </body></html>


9 个回复

倒序浏览
ShiG
高级会员   /  发表于:2024-3-13 14:48:50
沙发
回复 使用道具 举报
Joe.xu讲师达人认证 悬赏达人认证 活字格认证
超级版主   /  发表于:2024-3-13 17:14:45
板凳
感谢大家对活字格的支持
如果您的问题已解决,请及时更新帖子的状态为“已处理”,并设置最佳答案给有帮助到你的回复;
如果您的问题还未解决,欢迎跟帖补充;
如果您有新的问题,也欢迎创建新的求助帖呦。
回复 使用道具 举报
tominson
银牌会员   /  发表于:2024-3-13 17:58:57
地板
ShiG 发表于 2024-3-13 14:48
我就不重复发了   看这个  是你需求吗

【7.0.103.0】如何去掉富文本中的标签,只留下内容? - 活字格专 ...

这个解决不了我的需求,我是要提取出里边表格的内容,再保存到数据库
回复 使用道具 举报
VVANVI悬赏达人认证
论坛元老   /  发表于:2024-3-13 20:33:56
5#
爬虫可以搞,不过要搞代码
回复 使用道具 举报
Nathan.guo活字格认证 Wyn认证
超级版主   /  发表于:2024-3-14 14:11:28
6#
tominson 发表于 2024-3-13 17:58
这个解决不了我的需求,我是要提取出里边表格的内容,再保存到数据库

大佬,我理解咱们根据自己的需求调整对应javascript的处理思路即可;

至于保存数据库,只要咱们能拿到对应数据,存储岂不是手到擒来~~(当然具体使用什么方案,取决于大佬的解析结果是什么形式)
回复 使用道具 举报
VVANVI悬赏达人认证
论坛元老   /  发表于:2024-3-14 19:39:52
7#
Nathan.guo 发表于 2024-3-14 14:11
大佬,我理解咱们根据自己的需求调整对应javascript的处理思路即可;

至于保存数据库,只要咱们能拿到 ...

闲来无事,代码可以搞定, 里面两个表都可以转成json,  存数据库就相当easy了


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

评分

参与人数 1金币 +66 收起 理由
Nathan.guo + 66 很给力!

查看全部评分

回复 使用道具 举报
Nathan.guo活字格认证 Wyn认证
超级版主   /  发表于:2024-3-15 16:47:37
8#
给大佬点赞,太牛了~~
回复 使用道具 举报
tominson
银牌会员   /  发表于:2024-3-17 22:57:13
9#
VVANVI 发表于 2024-3-14 19:39
闲来无事,代码可以搞定, 里面两个表都可以转成json,  存数据库就相当easy了

厉害,大神,能把的完整代码提供一下吗,同时,里边的表格是2个的,能区分开来吗,如果表格2的数据有多行的时候,怎么转换成json

"<style id=""fixTableStyle"" type=""text/css"">th,td {border:1px solid #DDD;padding: 5px 10px;}</style><div id=""fixTableStyle"" type=""text/css"" cdata_tag=""style"" cdata_data=""th,td {border:1px solid #DDD;padding: 5px 10px;}"" _ue_custom_node_=""true""></div><p style=""line-height: normal; text-align: justify;""><strong style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; text-align: justify;"">一、项目编号:</strong><samp style=""font-family: inherit"" class=""bookmark-item uuid-1653371865344 code-00004 addWord single-line-text-input-box-cls"">QZZC2022-J1-00019-CGZX</samp></p><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-size: 18px; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; text-align: justify; white-space: normal;"">二、项目名称:</strong><samp style=""font-family: inherit"" class=""bookmark-item uuid-1653371882749 code-00003 addWord single-line-text-input-box-cls"">钦州港经济技术开发区中学物化生教学设备采购</samp></span></p><p style=""margin-bottom: 15px; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>三、中标(成交)信息</strong> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><div style="" font-size:16px;  font-family:微软雅黑;  line-height:20px; ""><p style=""line-height: normal; text-indent: 2em;"">1.中标结果:</p><table class=""template-bookmark uuid-1599570948000 code-AM014zbcj001 text-中标/成交结果信息"" width=""751"" style=""width:100%;border-collapse:collapse;""><thead><tr class=""firstRow""><th style=""background-color: rgb(255, 255, 255);"">序号</th><th style=""background-color: rgb(255, 255, 255);"">中标(成交)金额(元)</th><th style=""background-color: rgb(255, 255, 255);"">中标供应商名称</th><th style=""background-color: rgb(255, 255, 255);"">中标供应商地址</th></tr></thead><tbody><tr style=""text-align: center;"" width=""100%""><td class=""code-sectionNo"">1</td><td class=""code-summaryPrice"">报价:1489168(元)</td><td class=""code-winningSupplierName"">广西港联电子科技有限公司</td><td class=""code-winningSupplierAddr"">广西钦州市育才路79号</td></tr></tbody></table><p style=""line-height: normal; font-family: 微软雅黑; font-size: 16px; white-space: normal; text-indent: 2em;"">2.废标结果:&nbsp;&nbsp;</p><p style=""margin-bottom: 5px; line-height: normal; text-indent: 2em;"" class=""sub""><samp style=""font-family: inherit"" class=""bookmark-item uuid-1653371898814 code-41007  addWord""> &nbsp; &nbsp;</samp></p><table class=""form-panel-input-cls"" width=""100%""><tbody><tr style=""text-align: center;"" width=""100%"" class=""firstRow""><td width=""25.0%"" style=""word-break:break-all;"">序号</td><td width=""25.0%"" style=""word-break:break-all;"">标项名称</td><td width=""25.0%"" style=""word-break:break-all;"">废标理由</td><td width=""25.0%"" style=""word-break:break-all;"" colspan=""1"">其他事项</td></tr><tr style=""text-align: center;"" width=""100%""><td width=""25.0%"" style=""word-break:break-all;"">/</td><td width=""25.0%"" style=""word-break:break-all;"">/</td><td width=""25.0%"" style=""word-break:break-all;"">/</td><td width=""25.0%"" style=""word-break:break-all;"" colspan=""1"">/</td></tr></tbody></table>&nbsp;<p></p></div><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-size: 16px; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>四、主要标的信息</strong> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> &nbsp; &nbsp; &nbsp; &nbsp;</p><div style="" font-size:16px;  font-family:微软雅黑;  line-height:20px;""><div class=""class-condition-filter-block""><p style=""line-height: normal;""><span style=""font-size: 16px;"">&nbsp; &nbsp;货物类主要标的信息:</span> &nbsp; &nbsp;</p><p style=""line-height: normal;"" class=""sub"">&nbsp; &nbsp;&nbsp;<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653371945051 code-AM014GoodsInfoTab  addWord""> &nbsp; &nbsp; </samp></p><table class=""form-panel-input-cls"" width=""100%""><tbody><tr style=""text-align: center;"" width=""100%"" class=""firstRow""><td width=""14.29%"" style=""word-break:break-all;"">序号</td><td width=""14.29%"" style=""word-break:break-all;"">标项名称</td><td width=""14.29%"" style=""word-break:break-all;"">标的名称</td><td width=""14.29%"" style=""word-break:break-all;"">品牌</td><td width=""14.29%"" style=""word-break:break-all;"">数量</td><td width=""14.29%"" style=""word-break:break-all;"">单价(元)</td><td width=""14.29%"" style=""word-break:break-all;"" colspan=""1"">规格型号</td></tr><tr style=""text-align: center;"" width=""100%""><td width=""14.29%"" style=""word-break:break-all;"">1</td><td width=""14.29%"" style=""word-break:break-all;"">钦州港经济技术开发区中学物化生教学设备</td><td width=""14.29%"" style=""word-break:break-all;"">教师演示台</td><td width=""14.29%"" style=""word-break:break-all;"">齐鲁宏博</td><td width=""14.29%"" style=""word-break:break-all;"">1张</td><td width=""14.29%"" style=""word-break:break-all;"">10000</td><td width=""14.29%"" style=""word-break:break-all;"" colspan=""1"">HB-XX024</td></tr><tr style=""text-align: center;"" width=""100%""><td width=""14.29%"" style=""word-break:break-all;"">2</td><td width=""14.29%"" style=""word-break:break-all;"">钦州港经济技术开发区中学物化生教学设备</td><td width=""14.29%"" style=""word-break:break-all;"">智能交互平板</td><td width=""14.29%"" style=""word-break:break-all;"">TCL</td><td width=""14.29%"" style=""word-break:break-all;"">1台</td><td width=""14.29%"" style=""word-break:break-all;"">24000</td><td width=""14.29%"" style=""word-break:break-all;"" colspan=""1"">IFP86X60A</td></tr><tr style=""text-align: center;"" width=""100%""><td width=""14.29%"" style=""word-break:break-all;"">3</td><td width=""14.29%"" style=""word-break:break-all;"">钦州港经济技术开发区中学物化生教学设备</td><td width=""14.29%"" style=""word-break:break-all;"">壁挂展台</td><td width=""14.29%"" style=""word-break:break-all;"">云教</td><td width=""14.29%"" style=""word-break:break-all;"">1个</td><td width=""14.29%"" style=""word-break:break-all;"">800</td><td width=""14.29%"" style=""word-break:break-all;"" colspan=""1"">YJ-F800B</td></tr></tbody></table>&nbsp;<p></p></div></div><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-size: 16px; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>五、评审专家(单一来源采购人员)名单:</strong> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><span style=""line-height: 20px; font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><samp style=""font-family: inherit"" class=""bookmark-item uuid-1653371979715 code-85005 addWord multi-line-text-input-box-cls"">梁传理,陆桂发,梁存机(采购人代表)</samp>&nbsp;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-size: 16px; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>六、代理服务收费标准及金额:</strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><span style=""line-height: 20px; font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;"">1.代理服务收费标准:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372008127 code-AM01400039 addWord multi-line-text-input-box-cls"">按钦州市物价局“钦市价费[2013]4号”文件,以差额定率累进法计算</samp></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><span style=""line-height: 20px; font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;"">2.代理服务收费金额(元):<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372017940 code-AM01400040 editDisable numeric-input-box-cls readonly"">16304.68</samp></span></span></p><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-size: 16px; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>七、公告期限</strong> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><span style=""line-height: 20px; font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;"">自本公告发布之日起1个工作日。</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>八、其他补充事宜</strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372031416 code-81205  addWord""></samp>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""margin: 17px 0px; text-align: justify; break-after: avoid; font-size: 16px; font-family: SimHei, sans-serif; white-space: normal; line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""><strong>九、对本次公告内容提出询问,请按以下方式联系</strong>   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p style=""line-height: normal;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;; font-size: 16px;""></span></p><div style=""white-space: normal; font-family: 微软雅黑; line-height: 30px;""><div style=""line-height: 30px;""><p style=""line-height: 1.5em; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">1.采购人信息</span> &nbsp; &nbsp; &nbsp; &nbsp;</p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">名 称:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372055487 code-00014 editDisable interval-text-box-cls readonly"">钦州港经济技术开发区中学</samp></span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">地 址:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372061722 code-00018 addWord single-line-text-input-box-cls"">钦州港经济技术开发区中学</samp></span>&nbsp; &nbsp; &nbsp; &nbsp;</p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">联系方式:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372067358 code-00016 editDisable single-line-text-input-box-cls readonly"">0777-3880087</samp></span>&nbsp; &nbsp; &nbsp;</p><p style=""line-height: 1.5em; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">2.采购代理机构信息</span> &nbsp; &nbsp; &nbsp; &nbsp;</p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">名 称:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372092821 code-00009 addWord interval-text-box-cls"">钦州市政府采购中心</samp></span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">地 址:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372099014 code-00013 editDisable single-line-text-input-box-cls readonly"">金海湾大道8号市民服务中心</samp></span>&nbsp; &nbsp; &nbsp;&nbsp;</p><p style=""line-height: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">联系方式:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372111904 code-00011 addWord single-line-text-input-box-cls"">18877703003</samp></span>&nbsp; &nbsp; &nbsp; &nbsp;</p></div></div><p style=""line-height: 1.5em; white-space: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">3.项目联系方式</span></p><p style=""line-height: 1.5em; white-space: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">项目联系人:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372131779 code-00010 editDisable single-line-text-input-box-cls readonly"">莫丹丹</samp></span></p><p style=""line-height: 1.5em; white-space: normal; text-indent: 2em;""><span style=""font-family: 微软雅黑, &quot;Microsoft YaHei&quot;;"">电 话:<samp style=""font-family: inherit"" class=""bookmark-item uuid-1653372124900 code-00011 addWord single-line-text-input-box-cls"">18877703003</samp></span></p><p style=""line-height: normal;""><br/></p><p><br/></p><p><br/></p><p style='font-size' class='fjxx'>附件信息:</p><ul class=""fjxx"" style=""font-size: 16px;margin-left: 38px;color: #0065ef;list-style-type: none;""><li><p style=""display:inline-block""><a href=""https://zcy-gov-open-doc.oss-cn-north-2-gov-1.aliyuncs.com/1024FPA/450799/10008414986/202210/23eb6a9d-b75b-401d-842e-9bfc24622aea"">附件1.pdf</a></p><p style=""display:inline-block;margin-left:20px"">52.0K</p></li></ul>"
回复 使用道具 举报
Lay.Li悬赏达人认证 活字格认证
超级版主   /  发表于:2024-3-18 13:56:22
10#
大佬有空的话,可以分享分享,让我们学习学习哈@VVANVI
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部