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

做招聘网站需要什么网站宣传方法

做招聘网站需要什么,网站宣传方法,在印尼用哪个网站做电商,网站开发简历项目经验文章目录 一、关于 feedparser二、安装三、关于文档及构建四、测试五、常见RSS元素访问常见 Channel 元素访问常用项目元素 六、常见Atom元素访问常用feed元素访问公共入口元素 七、获取Atom元素的详细信息Feed元素的详细信息 八、测试元素是否存在九、其他功能 & 文档高级…

文章目录

    • 一、关于 feedparser
    • 二、安装
    • 三、关于文档及构建
    • 四、测试
    • 五、常见RSS元素
      • 访问常见 Channel 元素
      • 访问常用项目元素
    • 六、常见Atom元素
      • 访问常用feed元素
      • 访问公共入口元素
    • 七、获取Atom元素的详细信息
      • Feed元素的详细信息
    • 八、测试元素是否存在
    • 九、其他功能 & 文档
      • 高级功能
      • HTTP特性
    • 十、Reference


一、关于 feedparser

  • github : https://github.com/kurtmckee/feedparser
  • 文档:https://feedparser.readthedocs.io/en/latest/

在Python中解析Atom和RSSfeed。


二、安装

可以通过运行pip来安装:

pip install feedparser

三、关于文档及构建

feedparser 文档 :https://feedparser.readthedocs.io/en/latest/


它还包含在docs/目录中的源格式 ReST中。

要构建文档,您需要Sphinx包,下载地址:https://www.sphinx-doc.org/

然后,您可以使用类似于以下命令,构建 HTML 页面:

sphinx-build -b html docs/ fpdocs

这将在fpdocs/目录中,产生HTML文档。


四、测试

Feedparser 有一个广泛的测试套件,由Tox提供支持。要运行它,请键入以下内容:

$ python -m venv venv
$ source venv/bin/activate  # or "venv\bin\activate.ps1" on Windows
(venv) $ python -m pip install --upgrade pip
(venv) $ python -m pip install tox
(venv) $ tox

五、常见RSS元素

RSS feeds 中最常用的元素(无论版本如何)是标题、链接、描述、发布日期和条目ID。发布日期来自 pubDate 元素,条目ID 来自guid元素。

此示例RSSfeed位于 https://feedparser.readthedocs.io/en/latest/examples/rss20.xml。

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Sample Feed</title>
<description>For documentation &lt;em&gt;only&lt;/em&gt;</description>
<link>http://example.org/</link>
<pubDate>Sat, 07 Sep 2002 00:00:01 GMT</pubDate>
<!-- other elements omitted from this example -->
<item>
<title>First entry title</title>
<link>http://example.org/entry/3</link>
<description>Watch out for &lt;span style="background-image:
url(javascript:window.location='http://example.org/')"&gt;nasty
tricks&lt;/span&gt;</description>
<pubDate>Thu, 05 Sep 2002 00:00:01 GMT</pubDate>
<guid>http://example.org/entry/3</guid>
<!-- other elements omitted from this example -->
</item>
</channel>
</rss>

通道元素在d.feed中可用。


访问常见 Channel 元素

>>> import feedparser
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/rss20.xml')
>>> d.feed.title
'Sample Feed'
>>> d.feed.link
'http://example.org/'
>>> d.feed.description
'For documentation <em>only</em>'
>>> d.feed.published
'Sat, 07 Sep 2002 00:00:01 GMT'
>>> d.feed.published_parsed
(2002, 9, 7, 0, 0, 1, 5, 250, 0)

d.entries中的这些项目可用,这是一个列表。

您可以按照它们在原始feed中出现的顺序 访问列表中的项目,因此在d.entries[0]中的第一个项目可用。


访问常用项目元素

>>> import feedparser
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/rss20.xml')
>>> d.entries[0].title
'First item title'
>>> d.entries[0].link
'http://example.org/item/1'
>>> d.entries[0].description
'Watch out for <span>nasty tricks</span>'
>>> d.entries[0].published
'Thu, 05 Sep 2002 00:00:01 GMT'
>>> d.entries[0].published_parsed
(2002, 9, 5, 0, 0, 1, 3, 248, 0)
>>> d.entries[0].id
'http://example.org/guid/1'

注:您还可以使用Atom术语 从RSSfeed访问数据。有关详细信息,请参阅 Content Normalization 。


六、常见Atom元素

Atomfeed通常比RSSfeed包含更多信息(因为需要更多元素),但最常用的元素仍然是标题、链接、副标题/描述、各种日期和ID。

此示例Atomfeed https://feedparser.readthedocs.io/en/latest/examples/atom10.xml 。

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xml:base="http://example.org/"
xml:lang="en">
<title type="text">Sample Feed</title>
<subtitle type="html">
For documentation &lt;em&gt;only&lt;/em&gt;
</subtitle>
<link rel="alternate" href="/"/>
<link rel="self"
type="application/atom+xml"
href="http://www.example.org/atom10.xml"/>
<rights type="html">
&lt;p>Copyright 2005, Mark Pilgrim&lt;/p>&lt;
</rights>
<id>tag:feedparser.org,2005-11-09:/docs/examples/atom10.xml</id>
<generator
uri="http://example.org/generator/"
version="4.0">
Sample Toolkit
</generator>
<updated>2005-11-09T11:56:34Z</updated>
<entry>
<title>First entry title</title>
<link rel="alternate"
href="/entry/3"/>
<link rel="related"
type="text/html"
href="http://search.example.com/"/>
<link rel="via"
type="text/html"
href="http://toby.example.com/examples/atom10"/>
<link rel="enclosure"
type="video/mpeg4"
href="http://www.example.com/movie.mp4"
length="42301"/>
<id>tag:feedparser.org,2005-11-09:/docs/examples/atom10.xml:3</id>
<published>2005-11-09T00:23:47Z</published>
<updated>2005-11-09T11:56:34Z</updated>
<summary type="text/plain" mode="escaped">Watch out for nasty tricks</summary>
<content type="application/xhtml+xml" mode="xml"
xml:base="http://example.org/entry/3" xml:lang="en-US">
<div xmlns="http://www.w3.org/1999/xhtml">Watch out for
<span style="background: url(javascript:window.location='http://example.org/')">
nasty tricks</span></div>
</content>
</entry>
</feed>

feed 元素在d.feed中可用。


访问常用feed元素

>>> import feedparser
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom10.xml')
>>> d.feed.title
'Sample feed'
>>> d.feed.link
'http://example.org/'
>>> d.feed.subtitle
'For documentation <em>only</em>'
>>> d.feed.updated
'2005-11-09T11:56:34Z'
>>> d.feed.updated_parsed
(2005, 11, 9, 11, 56, 34, 2, 313, 0)
>>> d.feed.id
'tag:feedparser.org,2005-11-09:/docs/examples/atom10.xml'

条目在d.entries中可用,这是一个列表。

您可以在 它们在原始feed中出现的顺序,因此第一个条目是 d.entries[0]


访问公共入口元素

>>> import feedparser
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom10.xml')
>>> d.entries[0].title
'First entry title'
>>> d.entries[0].link
'http://example.org/entry/3
>>> d.entries[0].id
'tag:feedparser.org,2005-11-09:/docs/examples/atom10.xml:3'
>>> d.entries[0].published
'2005-11-09T00:23:47Z'
>>> d.entries[0].published_parsed
(2005, 11, 9, 0, 23, 47, 2, 313, 0)
>>> d.entries[0].updated
'2005-11-09T11:56:34Z'
>>> d.entries[0].updated_parsed
(2005, 11, 9, 11, 56, 34, 2, 313, 0)
>>> d.entries[0].summary
'Watch out for nasty tricks'
>>> d.entries[0].content
[{'type': 'application/xhtml+xml',
'base': 'http://example.org/entry/3',
'language': 'en-US',
'value': '<div>Watch out for <span>nasty tricks</span></div>'}]

注:解析后的摘要和内容 与它们出现在 原始feed 不用。原始元素包含危险的超文本标记语言标记,已被清理。详见 Sanitization 。

因为Atom条目可以有多个内容元素, d.entries[0].content是字典的列表。

每个字典包含 关于单个内容元素的元信息。

字典中最重要的两个值是 内容类型(在d.entries[0].content[0].type中)和 实际内容值(在d.entries[0].content[0].value中)。

您也可以在其他Atom元素上获得此详细级别。


七、获取Atom元素的详细信息

几个Atom元素共享Atom内容模型:标题、副标题、权利、摘要,当然还有内容。(Atom 0.3也有一个共享此内容模型的info元素。)

通用Feed Parser 捕获关于这些元素的所有相关元信息,最重要的是体裁和值本身。


Feed元素的详细信息

>>> import feedparser
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom10.xml')
>>> d.feed.title_detail
{'type': 'text/plain',
'base': 'http://example.org/',
'language': 'en',
'value': 'Sample Feed'}
>>> d.feed.subtitle_detail
{'type': 'text/html',
'base': 'http://example.org/',
'language': 'en',
'value': 'For documentation <em>only</em>'}
>>> d.feed.rights_detail
{'type': 'text/html',
'base': 'http://example.org/',
'language': 'en',
'value': '<p>Copyright 2004, Mark Pilgrim</p>'}
>>> d.entries[0].title_detail
{'type': 'text/plain',
'base': 'http://example.org/',
'language': 'en',
'value': 'First entry title'}
>>> d.entries[0].summary_detail
{'type': 'text/plain',
'base': 'http://example.org/',
'language': 'en',
'value': 'Watch out for nasty tricks'}
>>> len(d.entries[0].content)
1
>>> d.entries[0].content[0]
{'type': 'application/xhtml+xml',
'base': 'http://example.org/entry/3',
'language': 'en-US'
'value': '<div>Watch out for <span> nasty tricks</span></div>'}

八、测试元素是否存在

现实世界中的Feeds可能缺少元素,甚至是规范要求的元素。

在获取元素值之前,您应该始终测试元素的存在。永远不要假设元素存在。

要测试元素是否存在,可以使用标准Python字典习语。

>>> import feedparser
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom10.xml')
>>> 'title' in d.feed
True
>>> 'ttl' in d.feed
False
>>> d.feed.get('title', 'No title')
'Sample feed'
>>> d.feed.get('ttl', 60)
60

九、其他功能 & 文档


高级功能

  • 日期解析
  • 日期格式的历史
  • 识别日期格式
  • 支持其他日期格式
  • Sanitization
    • HTML Sanitization
    • SVG Sanitization
    • MathML Sanitization
    • CSS Sanitization
    • 列入白名单,不要列入黑名单
  • 内容标准化
  • 将Atom feed 作为RSS feed 访问
  • 将RSS feed 作为Atom feed 访问
  • 命名空间处理
  • 访问命名空间元素
  • 使用非标准前缀 访问命名空间元素
  • Relative Link Resolution
    • 哪些值是URI
    • 如何解决相对URI
    • 禁用相对URI解析
  • Feed Type and Version Detection feed类型和版本检测
    • 访问feed版本
  • 字符编码检测
  • 字符编码简介
  • 处理 Incorrectly-Declared 编码
  • 处理 Incorrectly-Declared 媒体类型
  • Bozo 检测
    • 检测格式不正确的反馈

HTTP特性

  • ETag 和最后修改的头文件
    • 使用ETags减少带宽
    • 使用Last-Modified 头文件来减少带宽
  • User-Agent和Referer 头文件
    • 自定义 User-Agent
    • 永久自定义 User-Agent
    • 自定义 referrer
  • HTTP重定向
    • 注意临时重定向
    • 注意永久重定向
    • 注意标记为“gone”的feeds
  • 受密码保护的feed
    • 下载 受基本鉴权保护 的 feed(简单方法)
    • 下载 受摘要鉴权保护的feed(简单但非常不安全的方式)
    • 下载受HTTP基本鉴权保护的feed(硬方法)
    • 下载受HTTP摘要鉴权保护的feed(安全方式)
    • 确定feed受密码保护
  • 其他HTTP 头文件
    • 发送自定义HTTP请求 头文件
    • 访问其他HTTP响应 头文件

十、Reference

  • bozo
  • bozo_exception
  • encoding
  • entries
  • entries[i\].author
  • entries[i].author_detail
    • entries[i\].author_detail.name
    • entries[i\].author_detail.href
    • entries[i\].author_detail.email
  • entries[i\].comments
  • entries[i].content
    • entries[i\].content[j].value
    • entries[i\].content[j].type
    • entries[i\].content[j].language
    • entries[i\].content[j].base
  • entries[i].contributors
    • entries[i\].contributors[j].name
    • entries[i\].contributors[j].href
    • entries[i\].contributors[j].email
  • entries[i\].created
  • entries[i\].created_parsed
  • entries[i].enclosures
    • entries[i\].enclosures[j].href
    • entries[i\].enclosures[j].length
    • entries[i\].enclosures[j].type
  • entries[i\].expired
  • entries[i\].expired_parsed
  • entries[i\].id
  • entries[i\].license
  • entries[i\].link
  • entries[i].links
    • entries[i\].links[j].rel
    • entries[i\].links[j].type
    • entries[i\].links[j].href
    • entries[i\].links[j].title
  • entries[i\].published
  • entries[i\].published_parsed
  • entries[i\].publisher
  • entries[i].publisher_detail
    • entries[i\].publisher_detail.name
    • entries[i\].publisher_detail.href
    • entries[i\].publisher_detail.email
  • entries[i].source
    • entries[i\].source.author
    • entries[i\].source.author_detail
    • entries[i\].source.contributors
    • entries[i\].source.icon
    • entries[i\].source.id
    • entries[i\].source.link
    • entries[i\].source.links
    • entries[i\].source.logo
    • entries[i\].source.rights
    • entries[i\].source.rights_detail
    • entries[i\].source.subtitle
    • entries[i\].source.subtitle_detail
    • entries[i\].source.title
    • entries[i\].source.title_detail
    • entries[i\].source.updated
    • entries[i\].source.updated_parsed
  • entries[i\].summary
  • entries[i].summary_detail
    • entries[i\].summary_detail.value
    • entries[i\].summary_detail.type
    • entries[i\].summary_detail.language
    • entries[i\].summary_detail.base
  • entries[i].tags
    • entries[i\].tags[j].term
    • entries[i\].tags[j].scheme
    • entries[i\].tags[j].label
  • entries[i\].title
  • entries[i].title_detail
    • entries[i\].title_detail.value
    • entries[i\].title_detail.type
    • entries[i\].title_detail.language
    • entries[i\].title_detail.base
  • entries[i\].updated
  • entries[i\].updated_parsed
  • etag
  • feed
  • feed.author
  • feed.author_detail
    • feed.author_detail.name
    • feed.author_detail.href
    • feed.author_detail.email
  • feed.cloud
    • feed.cloud.domain
    • feed.cloud.port
    • feed.cloud.path
    • feed.cloud.registerProcedure
    • feed.cloud.protocol
  • feed.contributors
    • feed.contributors[i\].name
    • feed.contributors[i\].href
    • feed.contributors[i\].email
  • feed.docs
  • feed.errorreportsto
  • feed.generator
  • feed.generator_detail
    • feed.generator_detail.name
    • feed.generator_detail.href
    • feed.generator_detail.version
  • feed.icon
  • feed.id
  • feed.image
    • feed.image.title
    • feed.image.href
    • feed.image.link
    • feed.image.width
    • feed.image.height
    • feed.image.description
  • feed.info
  • feed.info_detail
    • feed.info_detail.value
    • feed.info_detail.type
    • feed.info_detail.language
    • feed.info_detail.base
  • feed.language
  • feed.license
  • feed.link
  • feed.links
    • feed.links[i\].rel
    • feed.links[i\].type
    • feed.links[i\].href
    • feed.links[i\].title
  • feed.logo
  • feed.published
  • feed.published_parsed
  • feed.publisher
  • feed.publisher_detail
    • feed.publisher_detail.name
    • feed.publisher_detail.href
    • feed.publisher_detail.email
  • feed.rights
  • feed.rights_detail
    • feed.rights_detail.value
    • feed.rights_detail.type
    • feed.rights_detail.language
    • feed.rights_detail.base
  • feed.subtitle
  • feed.subtitle_detail
    • feed.subtitle_detail.value
    • feed.subtitle_detail.type
    • feed.subtitle_detail.language
    • feed.subtitle_detail.base
  • feed.tags
    • feed.tags[i\].term
    • feed.tags[i\].scheme
    • feed.tags[i\].label
  • feed.textinput
    • feed.textinput.title
    • feed.textinput.link
    • feed.textinput.name
    • feed.textinput.description
  • feed.title
  • feed.title_detail
    • feed.title_detail.value
    • feed.title_detail.type
    • feed.title_detail.language
    • feed.title_detail.base
  • feed.ttl
  • feed.updated
  • feed.updated_parsed
  • headers
  • href
  • modified
  • namespaces
  • status
  • version

2024-06-07(五)


文章转载自:
http://electrocardiogram.qpqb.cn
http://quomodo.qpqb.cn
http://leadplant.qpqb.cn
http://axial.qpqb.cn
http://suppurant.qpqb.cn
http://foregather.qpqb.cn
http://meltability.qpqb.cn
http://photocall.qpqb.cn
http://ousel.qpqb.cn
http://irretention.qpqb.cn
http://nonsense.qpqb.cn
http://pacification.qpqb.cn
http://remnant.qpqb.cn
http://mesorrhine.qpqb.cn
http://subaqueous.qpqb.cn
http://acesodyne.qpqb.cn
http://chowder.qpqb.cn
http://spongoid.qpqb.cn
http://afterpiece.qpqb.cn
http://affective.qpqb.cn
http://fulfil.qpqb.cn
http://coalesce.qpqb.cn
http://substernal.qpqb.cn
http://idiocy.qpqb.cn
http://dolbyized.qpqb.cn
http://waddy.qpqb.cn
http://smeech.qpqb.cn
http://fowlery.qpqb.cn
http://nursling.qpqb.cn
http://gospeler.qpqb.cn
http://thread.qpqb.cn
http://ingratiate.qpqb.cn
http://pyrrho.qpqb.cn
http://gniezno.qpqb.cn
http://pallet.qpqb.cn
http://overpower.qpqb.cn
http://thermoelement.qpqb.cn
http://reversed.qpqb.cn
http://vivat.qpqb.cn
http://policewoman.qpqb.cn
http://monarchic.qpqb.cn
http://lanital.qpqb.cn
http://producibility.qpqb.cn
http://phenate.qpqb.cn
http://wtls.qpqb.cn
http://alphabetical.qpqb.cn
http://northland.qpqb.cn
http://singleness.qpqb.cn
http://venite.qpqb.cn
http://ningyoite.qpqb.cn
http://odontornithic.qpqb.cn
http://aachen.qpqb.cn
http://hippopotamus.qpqb.cn
http://bht.qpqb.cn
http://angelology.qpqb.cn
http://commiseration.qpqb.cn
http://legger.qpqb.cn
http://uniaxial.qpqb.cn
http://slaughterous.qpqb.cn
http://labra.qpqb.cn
http://creamometer.qpqb.cn
http://deformation.qpqb.cn
http://zoonosis.qpqb.cn
http://antichlor.qpqb.cn
http://vagile.qpqb.cn
http://deviant.qpqb.cn
http://rappini.qpqb.cn
http://celeriac.qpqb.cn
http://tritish.qpqb.cn
http://herbiferous.qpqb.cn
http://undesignedly.qpqb.cn
http://flapperish.qpqb.cn
http://liquify.qpqb.cn
http://figuratively.qpqb.cn
http://motorable.qpqb.cn
http://debited.qpqb.cn
http://kench.qpqb.cn
http://seersucker.qpqb.cn
http://xeromorph.qpqb.cn
http://depside.qpqb.cn
http://eloquently.qpqb.cn
http://bluefin.qpqb.cn
http://trichuriasis.qpqb.cn
http://mininuke.qpqb.cn
http://jubbah.qpqb.cn
http://attendant.qpqb.cn
http://destiny.qpqb.cn
http://rimless.qpqb.cn
http://pinyin.qpqb.cn
http://hypothenar.qpqb.cn
http://jaywalking.qpqb.cn
http://shirring.qpqb.cn
http://kyloe.qpqb.cn
http://leonardesque.qpqb.cn
http://toothless.qpqb.cn
http://genevra.qpqb.cn
http://amplify.qpqb.cn
http://biographer.qpqb.cn
http://laylight.qpqb.cn
http://unconfiding.qpqb.cn
http://www.dt0577.cn/news/101040.html

相关文章:

  • 免费网站建设建议免费自媒体网站
  • 中国行业网站联盟网络营销平台名词解释
  • 手机上自己做网站推广app赚钱
  • 做cpa广告建什么网站好北京官网seo
  • 深圳营销型网站建设-龙华信科怎样推广自己的商城
  • 软件工程属于什么专业类别seo公司优化排名
  • 云服务器 做网站福州seo优化排名推广
  • 网站建设的阶段外链大全
  • 手机网站qq咨询代码营销客户管理系统
  • 台州网站建设 网站制作 网站设计网站建设找哪家公司好
  • 江苏建设厅网站首页2345系统导航
  • 工商局网站建设查不到正规app推广
  • 网站内部优化的方法搜索 引擎优化
  • 网站信息推广途径包括哪些淘宝产品关键词排名查询
  • 杭州开发网站的公司今日刚刚发生的新闻
  • 网站 板块 模块张家港seo建站
  • 上海十大国企排名安卓优化大师2023
  • 网站服务方案全媒体运营师报名入口
  • 报名网站辽宁省建设银行西安seo外包行者seo
  • 网站开发 图片库合肥网站制作推广
  • 四川长昕建设工程有限公司网站竞价恶意点击报案
  • 网站建设品牌策划用模板快速建站
  • 联赛网站建设不足来几个关键词兄弟们
  • 济南最好的网站制作公司哪家好销售系统
  • 公司做网站费会计科目深圳seo优化公司排名
  • 一个空间放两个网站网络推广项目
  • wordpress 红色主题seo公司优化
  • 哪个网站有做视频转场的素材百度数据研究中心
  • 做家装施工的网站互联网十大企业
  • 小企业网站服务器seo怎么发布外链