python中feedparser的输出意外截断

python中feedparser的输出意外截断,python,rss,feedparser,Python,Rss,Feedparser,我正在写一段代码来解析来自RSS提要的信息。我正在存储解析后的信息,以备日后研究。在手头的案例中,我希望存储[姓名、姓氏、内幕交易类型、价格,…]等信息 我的问题 我试图解析的字符串大于1800个字符,但是我的解析器输出的字符串只有大约330个字符,并且以“…”结尾。 我的问题是如何在Python中调整字符串feedparser解析的最大长度?或者,为什么我的代码在打印或存储时会被截断,而没有在其EntID中列出 我试过的 输出 看起来像: Notification and public dis

我正在写一段代码来解析来自RSS提要的信息。我正在存储解析后的信息,以备日后研究。在手头的案例中,我希望存储[姓名、姓氏、内幕交易类型、价格,…]等信息

我的问题 我试图解析的字符串大于1800个字符,但是我的解析器输出的字符串只有大约330个字符,并且以“…”结尾。 我的问题是如何在Python中调整字符串feedparser解析的最大长度?或者,为什么我的代码在打印或存储时会被截断,而没有在其EntID中列出

我试过的 输出 看起来像:

Notification and public disclosure of transactions by persons discharging managerial responsibilities and persons closely associated with them 23.06.2020 / 18:37 The issuer is solely responsible for the content of this announcement. *1. Details of the person discharging managerial responsibilities / person closely associated*...
但应如下所示:(忽略feedparser默认情况下似乎已清除的制动器)

在这里使用这个例子

我还试图找到一个合适的标志/关键字来定义中解析字符串的最大长度,但运气不佳

期待您的帮助,非常感谢

明白了 因此,feedparser没有问题。网站RSS提要的内容只是网站上显示的内容的一个截短版本,下面提要的摘录清楚地显示了每个标题的内容

看起来我必须解析RSS提要附带的完整内容的链接,并解析我需要的信息

<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href='https://www.w3.org/2000/08/w3c-synd/style.css' type='text/css'?>
<rss version='2.0' xmlns:media="https://search.yahoo.com/mrss/">
  <channel>
    <title>finanztreff.de / INSIDERTRADES </title>
    <description>News und Berichte aus der Finanzwelt von finanztreff.de</description>
    <language>de-de</language>
    <copyright>Copyright 2020 vwd netsolutions GmbH</copyright>
    <lastBuildDate>2020-06-25T12:26:48+02:00</lastBuildDate>
    <link>https://www.finanztreff.de</link>
    <image>
      <title>finanztreff.de-Logo</title>
      <url>https://www.finanztreff.de/images/finanztreff.jpg</url>
      <link>https://www.finanztreff.de</link>
    </image>
  <item>
    <title>EANS-DD: Oberbank AG / Mitteilung über Eigengeschäfte von Führungskräften gemäß Artikel 19 MAR - ANHANG</title>
    <link>http://www.finanztreff.de/news/eans-dd-oberbank-ag+mitteilung-ueber-eigengeschaefte-von-fuehrungskraeften-gemaess-artikel/20867797</link>
    <description>Directors&apos; Dealings-Mitteilung gemäß Artikel 19 MAR übermittelt durch euro adhoc mit dem Ziel einer europaweiten Verbreitung. Für den Inhalt ist der Emittent verantwortlich. Personenbezogene Daten: Mitteilungspflichtige Person: Name: Elfriede Höchtel (Natürliche Person) Grund der Mitteilungspflicht: Grund: Meldepflichtige...</description>
    <enclosure url='https:' length='' type='image/' />
    <media:keywords></media:keywords>
    <media:thumbnail url='https:' width='' height='' />
    <media:thumbnail url='https:' width='' height='' />
    <pubDate>2020-06-25T11:59:05+02:00</pubDate>
    <guid>20867797</guid>
知道了 因此,feedparser没有问题。网站RSS提要的内容只是网站上显示的内容的一个截短版本,下面提要的摘录清楚地显示了每个标题的内容

看起来我必须解析RSS提要附带的完整内容的链接,并解析我需要的信息

<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href='https://www.w3.org/2000/08/w3c-synd/style.css' type='text/css'?>
<rss version='2.0' xmlns:media="https://search.yahoo.com/mrss/">
  <channel>
    <title>finanztreff.de / INSIDERTRADES </title>
    <description>News und Berichte aus der Finanzwelt von finanztreff.de</description>
    <language>de-de</language>
    <copyright>Copyright 2020 vwd netsolutions GmbH</copyright>
    <lastBuildDate>2020-06-25T12:26:48+02:00</lastBuildDate>
    <link>https://www.finanztreff.de</link>
    <image>
      <title>finanztreff.de-Logo</title>
      <url>https://www.finanztreff.de/images/finanztreff.jpg</url>
      <link>https://www.finanztreff.de</link>
    </image>
  <item>
    <title>EANS-DD: Oberbank AG / Mitteilung über Eigengeschäfte von Führungskräften gemäß Artikel 19 MAR - ANHANG</title>
    <link>http://www.finanztreff.de/news/eans-dd-oberbank-ag+mitteilung-ueber-eigengeschaefte-von-fuehrungskraeften-gemaess-artikel/20867797</link>
    <description>Directors&apos; Dealings-Mitteilung gemäß Artikel 19 MAR übermittelt durch euro adhoc mit dem Ziel einer europaweiten Verbreitung. Für den Inhalt ist der Emittent verantwortlich. Personenbezogene Daten: Mitteilungspflichtige Person: Name: Elfriede Höchtel (Natürliche Person) Grund der Mitteilungspflicht: Grund: Meldepflichtige...</description>
    <enclosure url='https:' length='' type='image/' />
    <media:keywords></media:keywords>
    <media:thumbnail url='https:' width='' height='' />
    <media:thumbnail url='https:' width='' height='' />
    <pubDate>2020-06-25T11:59:05+02:00</pubDate>
    <guid>20867797</guid>
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href='https://www.w3.org/2000/08/w3c-synd/style.css' type='text/css'?>
<rss version='2.0' xmlns:media="https://search.yahoo.com/mrss/">
  <channel>
    <title>finanztreff.de / INSIDERTRADES </title>
    <description>News und Berichte aus der Finanzwelt von finanztreff.de</description>
    <language>de-de</language>
    <copyright>Copyright 2020 vwd netsolutions GmbH</copyright>
    <lastBuildDate>2020-06-25T12:26:48+02:00</lastBuildDate>
    <link>https://www.finanztreff.de</link>
    <image>
      <title>finanztreff.de-Logo</title>
      <url>https://www.finanztreff.de/images/finanztreff.jpg</url>
      <link>https://www.finanztreff.de</link>
    </image>
  <item>
    <title>EANS-DD: Oberbank AG / Mitteilung über Eigengeschäfte von Führungskräften gemäß Artikel 19 MAR - ANHANG</title>
    <link>http://www.finanztreff.de/news/eans-dd-oberbank-ag+mitteilung-ueber-eigengeschaefte-von-fuehrungskraeften-gemaess-artikel/20867797</link>
    <description>Directors&apos; Dealings-Mitteilung gemäß Artikel 19 MAR übermittelt durch euro adhoc mit dem Ziel einer europaweiten Verbreitung. Für den Inhalt ist der Emittent verantwortlich. Personenbezogene Daten: Mitteilungspflichtige Person: Name: Elfriede Höchtel (Natürliche Person) Grund der Mitteilungspflicht: Grund: Meldepflichtige...</description>
    <enclosure url='https:' length='' type='image/' />
    <media:keywords></media:keywords>
    <media:thumbnail url='https:' width='' height='' />
    <media:thumbnail url='https:' width='' height='' />
    <pubDate>2020-06-25T11:59:05+02:00</pubDate>
    <guid>20867797</guid>
import requests
from bs4 import BeautifulSoup
html_text = requests.get("http://www.finanztreff.de/news/dgap-dd-encavis-ag-english/20845911").text
soup = BeautifulSoup(html_text, 'html.parser')
print(soup.find(id="newsSource56").text)