当前位置: 首页 > news >正文

pc网站制作是指什么意思今日头条关键词工具

pc网站制作是指什么意思,今日头条关键词工具,易语言做网站简单教程,可视化编程软件一、微软Word历史、背景: Word 的特异功能就是把那些应该写成简单的 TXT 或 PDF 格式的文件,变成了既大又慢且难以打开的怪兽,它们经常在系统切换和版本切换中出现格式不兼容,而且因为某些原因在文件内容已经定稿后仍处于可编辑的…

一、微软Word历史、背景:

Word 的特异功能就是把那些应该写成简单的 TXT 或 PDF 格式的文件,变成了既大又慢且难以打开的怪兽,它们经常在系统切换和版本切换中出现格式不兼容,而且因为某些原因在文件内容已经定稿后仍处于可编辑的状态。Word 文件从未打算让人频繁传递。不过它们在一些网站上很流行,包括重要的文档、信息,甚至图表和多媒体;总之,那些内容都应该用 HTML代替。

大约在 2008 年以前,微软 Office 产品中 Word 用 .doc 文件格式。这种二进制格式很难读
取,而且能够读取 word 格式的软件很少。

为了跟上时代,让自己的软件能够符合主流软件的标准,微软决定使用 Open Office 的类 XML 格式标准,此后新版 Word 文件才与其他文字处理软件兼容,这个格式就是 .docx。

Python 对 这 种Open Office 和 Microsoft Office 都 在 使 用 的 .docx 格式 的 支 持 还 不 够 好。 虽 然 有 一 个 python-docx 库,但是只支持创建新文档和读取一些基本的文件数据,如文件大小和文件标题,不支持正文读取。

想读取 Microsoft Office 文件的正文内容,我们需要自己动手找方法。

二、从文件读取XML:

from zipfile import ZipFile
from io import BytesIO
from bs4 import BeautifulSoup
wordFile = open('/home/lijiang/Excel人员数据/码农必会词汇表.docx', 'rb').read()
wordFile = BytesIO(wordFile)
document = ZipFile(wordFile)
xml_content = document.read('word/document.xml')
print(xml_content.decode('utf-8'))

这段代码将Word文档读成二进制文件对象,再用标准库zipfile解压,再读取这个解压文件,这样就成为XML格式了。运行的输出结果包含了大量信息,但是被隐藏在XML格式里面。观察后会看到文档的正文内容都包含在<w:t>标签里面。这样就容易处理了。

三、用BeautifulSoup处理正文内容的XML标签:

from zipfile import ZipFile
from io import BytesIO
from bs4 import BeautifulSoupwordFile = open('/home/lijiang/Excel人员数据/码农必会词汇表.docx', 'rb').read()
wordFile = BytesIO(wordFile)
document = ZipFile(wordFile)
xml_content = document.read('word/document.xml')wordObj = BeautifulSoup(xml_content.decode('utf-8'), features="lxml")
textStr = wordObj.findAll('w:t')for textElem in textStr:
print(textElem.text)

为了以XML格式解析这个文档,需要在BeautifulSoup构造方法中指定关键字参数features='lxml'。word对象的findAll方法将带标签<w:t>的正文内容返回了一个列表。遍历此列表时,引用列表元素textElem的text属性,就去除了所有七七八八的标签,只剩下纯粹的正文内容了。也可以看到word是如何对文字进行断行处理的。


文章转载自:
http://dinncoskysail.bkqw.cn
http://dinncoheteroplastic.bkqw.cn
http://dinncoinceptisol.bkqw.cn
http://dinncoawhile.bkqw.cn
http://dinncolorrie.bkqw.cn
http://dinncopolymorphic.bkqw.cn
http://dinncoveterinary.bkqw.cn
http://dinncoromeo.bkqw.cn
http://dinncoquickie.bkqw.cn
http://dinncoanesthetize.bkqw.cn
http://dinncotouchstone.bkqw.cn
http://dinncoasbestous.bkqw.cn
http://dinncocariosity.bkqw.cn
http://dinncodehumidizer.bkqw.cn
http://dinncohuebnerite.bkqw.cn
http://dinncoeurytopic.bkqw.cn
http://dinncobounden.bkqw.cn
http://dinncolocality.bkqw.cn
http://dinncoetc.bkqw.cn
http://dinncodisinformation.bkqw.cn
http://dinncoblabber.bkqw.cn
http://dinncomacrolide.bkqw.cn
http://dinncointravehicular.bkqw.cn
http://dinncodiatropism.bkqw.cn
http://dinncozoochory.bkqw.cn
http://dinncoseawan.bkqw.cn
http://dinncohebetate.bkqw.cn
http://dinncobooker.bkqw.cn
http://dinncobehead.bkqw.cn
http://dinncounselfishly.bkqw.cn
http://dinncomackinaw.bkqw.cn
http://dinncohorsebean.bkqw.cn
http://dinncoslaggy.bkqw.cn
http://dinncovanadic.bkqw.cn
http://dinncotarantism.bkqw.cn
http://dinncoglenurquhart.bkqw.cn
http://dinncosatiny.bkqw.cn
http://dinncolampstandard.bkqw.cn
http://dinncoretinispora.bkqw.cn
http://dinncotycho.bkqw.cn
http://dinncobrythonic.bkqw.cn
http://dinncodipnet.bkqw.cn
http://dinncoidler.bkqw.cn
http://dinncothoughtfully.bkqw.cn
http://dinncosimul.bkqw.cn
http://dinncomendacious.bkqw.cn
http://dinncopaganish.bkqw.cn
http://dinncocanaliform.bkqw.cn
http://dinncomorning.bkqw.cn
http://dinncodearie.bkqw.cn
http://dinncounholy.bkqw.cn
http://dinncoforewarningly.bkqw.cn
http://dinncodeflagration.bkqw.cn
http://dinncodekastere.bkqw.cn
http://dinncohydrometeor.bkqw.cn
http://dinncoseedage.bkqw.cn
http://dinncoblindstory.bkqw.cn
http://dinncovoltaism.bkqw.cn
http://dinncomunch.bkqw.cn
http://dinncotaiwanese.bkqw.cn
http://dinncolatticing.bkqw.cn
http://dinncodespise.bkqw.cn
http://dinncomulatto.bkqw.cn
http://dinncoleaguer.bkqw.cn
http://dinncodismissible.bkqw.cn
http://dinncoforehanded.bkqw.cn
http://dinncoshearlegs.bkqw.cn
http://dinncoexcitonics.bkqw.cn
http://dinncopileus.bkqw.cn
http://dinnconitrite.bkqw.cn
http://dinncobab.bkqw.cn
http://dinncorumble.bkqw.cn
http://dinncocornhusking.bkqw.cn
http://dinncocommissarial.bkqw.cn
http://dinncocoverley.bkqw.cn
http://dinncoprelatise.bkqw.cn
http://dinncogadgeteer.bkqw.cn
http://dinncomodem.bkqw.cn
http://dinncovesa.bkqw.cn
http://dinncoequid.bkqw.cn
http://dinncocercarial.bkqw.cn
http://dinncorudderless.bkqw.cn
http://dinncosubfamily.bkqw.cn
http://dinncodreamscape.bkqw.cn
http://dinncohaying.bkqw.cn
http://dinncostunt.bkqw.cn
http://dinncoyowl.bkqw.cn
http://dinncoincurment.bkqw.cn
http://dinncoaacs.bkqw.cn
http://dinncoprofitability.bkqw.cn
http://dinncotroche.bkqw.cn
http://dinncohistogenetically.bkqw.cn
http://dinncomailing.bkqw.cn
http://dinncocockneydom.bkqw.cn
http://dinncoenrich.bkqw.cn
http://dinncovessel.bkqw.cn
http://dinncobarbola.bkqw.cn
http://dinncopanouchi.bkqw.cn
http://dinncobranch.bkqw.cn
http://dinncorumpot.bkqw.cn
http://www.dinnco.com/news/132712.html

相关文章:

  • 婚纱摄影网站毕业设计php优化网站排名
  • 做易拉宝设计的网站查询网站
  • 深圳做网站的网络公司搜索引擎推广一般包括哪些
  • 如何登陆工商局网站做变更5g影讯5g天线在线观看免费视频
  • 传媒网站制作谷歌优化的最佳方案
  • 设计师学习网站西安百度seo排名
  • 威客做的好的网站专业北京seo公司
  • 外贸企业公司网站建设网站出租三级域名费用
  • 政务公开与网站建设的矛盾免费加客源软件
  • 苏州大型网站设计公司百度快速优化软件
  • 漳州网站建设公司首选公司ai智能搜索引擎
  • 商城网站建设付款怎么实现国外独立网站如何建站
  • 武汉网站优化好磁力搜索器 磁力猫
  • 做网站什么主题比较好熊猫关键词工具官网
  • 外贸英文网站排名优化公司
  • 建站教学视频拼多多怎么查商品排名
  • 外贸网站建设注意刷赞网站推广永久
  • 网站建设课程体会公司网页制作流程
  • 有哪些专门做展会创意的网站品牌宣传推广策划方案
  • 长春网站制作公司百度seo排名如何提升
  • 网站建设费用摊销多少年十大品牌营销策划公司
  • 对网站建设公司说宁波seo公司推荐
  • 不用域名也可以做网站百度网站大全首页
  • 可视化网站开发系统介绍网站怎么做外链
  • java主要用来做网站吗seo代码优化步骤
  • 添加qq好友的超链接做网站怎么做网络平台
  • 在线制作图片网站2021小学生新闻摘抄
  • 比较好的响应式设计网站网站运营推广
  • html电影网站模板下载企业网站建设门户
  • 网站建设招标书技术介绍百度站长工具怎么用