简体   繁体   English

转换某 <div> 从多个HTML文件转换为Excel文件

[英]converting a certain <div> from multiple html files to an excel file

I have a lot of product descriptions from my old website which I would like to assemble in some way, and convert them into an excel file that I can use for an import for my new website's CMS. 我有许多旧网站上的产品说明,我希望以某种方式进行组合,然后将它们转换为excel文件,以便将其导入新网站的CMS。

My real question here is: is there any way of getting all the bits of text included in all the <div id="description"> tags which are on all the product pages (I downloaded these pages as HTML files from the FTP server of my website)? 我真正的问题是:有没有办法获取所有产品页面上所有<div id="description">标记中包含的所有文本位(我从HTML的FTP服务器以HTML文件的形式下载了这些页面)我的网站)?

All the methods you'll need to do this are included in the HTMLDocument Class . HTMLDocument Class中包含了您需要执行的所有方法。

More specifically, look at the body property and its methods. 更具体地说,请查看body属性及其方法。

Another question is very closely related and should definetly be looked at. 另一个问题是密切相关的,应该明确地加以考虑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM