Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8762245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:28:39+00:00 2026-06-13T15:28:39+00:00

I’m testing feedparser on my rss feed. It works like a charm and I

  • 0

I’m testing feedparser on my rss feed.
It works like a charm and I get all the entries.

Some news has an embedded youtube player, but this just does not appear in the return values of feedparser.

My code is simply:

d = feedparser.parse('http://feeds.feedburner.com/NotciasPs3evita-Mypst')

This returns (excerpt):

 guidislink': False,
          'id': u'http://mypst.com.br/forum/index.php?/topic/17336-gamegen-call-of-duty-black-ops-2-ganha-trailer-com-acao-real-e-muitas-surpresas/',
          'link': u'http://mypst.com.br/forum/index.php?/topic/17336-gamegen-call-of-duty-black-ops-2-ganha-trailer-com-acao-real-e-muitas-surpresas/',
          'links': [{'href': u'http://mypst.com.br/forum/index.php?/topic/17336-gamegen-call-of-duty-black-ops-2-ganha-trailer-com-acao-real-e-muitas-surpresas/',
                     'rel': u'alternate',
                     'type': u'text/html'}],
          'published': u'Mon, 29 Oct 2012 14:53:58 +0000',
          'published_parsed': time.struct_time(tm_year=2012, tm_mon=10, tm_mday=29, tm_hour=14, tm_min=53, tm_sec=58, tm_wday=0, tm_yday=303, tm_isdst=0),
          'summary': u'A Activision revelou hoje um novo trailer de Call of Duty: Black Ops 2, substituindo as cenas de a\xe7\xe3o do jogo por cenas de a\xe7\xe3o na vida real. O trailer traz diversas \u201csurpresas\u201d e alguns zumbis.<br />\n<br />\n<br />\n<br />\nCall of Duty: Black Ops 2 chegar\xe1 no dia 13 de novembro nos Estados Unidos.<br />\n<br />\n<br />\n<em class="bbc"><strong class="bbc">Fonte: <a class="bbc_url" href="http://www.gamegen.com.br/playstation3/call-of-duty-black-ops-2-ganha-trailer-com-acao-real-e-muitas-surpresas/" rel="nofollow external" title="Link externo">GameGeneration</a></strong></em>',
          'summary_detail': {'base': u'http://feeds.feedburner.com/NotciasPs3evita-Mypst',
                             'language': None,
                             'type': u'text/html',
                             'value': u'A Activision revelou hoje um novo trailer de Call of Duty: Black Ops 2, substituindo as cenas de a\xe7\xe3o do jogo por cenas de a\xe7\xe3o na vida real. O trailer traz diversas \u201csurpresas\u201d e alguns zumbis.<br />\n<br />\n<br />\n<br />\nCall of Duty: Black Ops 2 chegar\xe1 no dia 13 de novembro nos Estados Unidos.<br />\n<br />\n<br />\n<em class="bbc"><strong class="bbc">Fonte: <a class="bbc_url" href="http://www.gamegen.com.br/playstation3/call-of-duty-black-ops-2-ganha-trailer-com-acao-real-e-muitas-surpresas/" rel="nofollow external" title="Link externo">GameGeneration</a></strong></em>'},
          'title': u'[GameGen] Call of Duty: Black Ops 2 ganha trailer com a\xe7\xe3o real e muitas surpresas',
          'title_detail': {'base': u'http://feeds.feedburner.com/NotciasPs3evita-Mypst',
                           'language': None,
                           'type': u'text/plain',
                           'value': u'[GameGen] Call of Duty: Black Ops 2 ganha trailer com a\xe7\xe3o real e muitas surpresas'}},

Everything is in place except for the youtube player <object> tag. Is this a feedparser bug or a problem on my rss? Is there other lib on python to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:28:42+00:00Added an answer on June 13, 2026 at 3:28 pm

    The feedparser sanitizes HTML input and <object>, <param> and <embed> tags are stripped by default.

    You need to either disable sanitization (only if you truly trust the source), or whitelist the YouTube tags.

    To disable sanitization, set SANITIZE_HTML to False:

    feedparser.SANITIZE_HTML = False
    

    To add to the whitelist, add elements to the _HTMLSanitizer.acceptable_elements set:

    _HTMLSanitizer.acceptable_elements.update(['object', 'param', 'embed'])
    

    Both methods have inherent risks, and you are opening yourself to attacks this way. The approach I’d use is to switch of sanitization altogether, but then use some other method to sanitize the HTML, probably using lxml.html.clean with a whitelist and listing YouTube in host_whitelist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.