473,396 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

BeautifulSoup - extract the <object tag

I'm trying to extract something like this:

<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=7,0,19,0" width=640 height=400>
<param name=movie value=url>
<param name=quality value=high><param name=SCALE value=showall>
<embed src=url quality=highpluginspage=http://www.macromedia.com/go/
getflashplayer type=application/x-shockwave-flash width=640 height=400
bgcolor=#000000 scale= showall>
</embed>
</object>

====
I don't know how I can get the param

# below don't work
for test in soup.fetch('object'):
print test # nothing

# nothing
print soup.findAll('param',{'name':'movie'})

# nothing
print soup.findAll('object')

Is it possible with BeautifulSoup to extract the object tag with his
child param ?
I have made everything in BeautifulSoup so I hope its possible :S

Thanks anyway,
GCMartijn

Jun 18 '07 #1
1 3335
In <11**********************@u2g2000hsc.googlegroups. com>, gcmartijn
wrote:
I'm trying to extract something like this:

<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=7,0,19,0" width=640 height=400>
<param name=movie value=url>
<param name=quality value=high><param name=SCALE value=showall>
<embed src=url quality=highpluginspage=http://www.macromedia.com/go/
getflashplayer type=application/x-shockwave-flash width=640 height=400
bgcolor=#000000 scale= showall>
</embed>
</object>

====
I don't know how I can get the param

# below don't work
for test in soup.fetch('object'):
print test # nothing
There's no `fetch()`.

In [15]: soup.fetch('object')
---------------------------------------------------------------------------
exceptions.TypeError Traceback (most recent call last)

/home/new/<ipython console>

TypeError: 'NoneType' object is not callable
# nothing
print soup.findAll('param',{'name':'movie'})
Works for me:

In [16]: soup.findAll('param', {'name': 'movie'})
Out[16]:
[<param name="movie" value="url">
</param>]
# nothing
print soup.findAll('object')
This too:

In [17]: soup.findAll('object')
Out[17]:
[<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=7,0,19,0" width="640" height="400">
<param name="movie" value="url">
</param><param name="quality" value="high"></param><param name="SCALE" value="showall">
<embed src="url" quality="highpluginspage=http://www.macromedia.com/go/" getflashplayer="getflashplayer" type="application/x-shockwave-flash" width="640" height="400" bgcolor="#000000" scale="showall">
</embed>
</param></object>]

Ciao,
Marc 'BlackJack' Rintsch
Jun 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang Schwanke | last post by:
Dear usenet, I'm having the following small problem. I've been ask to add some Quicktime panoramas to a website. The author of the panoramas has made two versions of each: One in MOV format,...
6
by: Christopher Benson-Manica | last post by:
(I posted this as a reply to my thread about iframes, but I think it may get mostly ignored there.) http://ataru.gomen.org/files/test.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"...
4
by: KC | last post by:
Could some one explain to me the casting rules for sending generic lists, ex. List<Person>, to a function that accepts List<object>? I cannot get the following easy-cheesy app to work. I get the...
1
by: easy.lin | last post by:
.... <object id="10">door</object> .... I try to write this in clipse XSD editor <element name="object" type="string"> <attribute name="id" type="int"></attribute> </element> but get wrong...
4
by: colson | last post by:
Hi, If I have a class A, and a List<List<object>> containing instances of A. How do I explicitly cast List<List<object>> as List<List<A>>?
1
by: tilt | last post by:
Hello, I use an object element to replace the iframe element in ie, like this: <object id="x_obj" data="http://.../" type="text/html"> <iframe name="x_if" id="x_if"...
9
by: Stephan Steiner | last post by:
Hi I seem to have a bit of trouble understanding one bit of how generics work: In C#, every class automatically derives from object, and inherits a bunch of properties (i.e. ToString()). Thus,...
4
by: Alan Silver | last post by:
Hello, I have an <objecttag that is used to display a Flash file. I would like the whole Flash file to be a link. The obvious thought would be to do this... <a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.