crajesh
unread,Nov 2, 2009, 8:49:35 AM11/2/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to beautifulsoup
Hi
I am new in python ,i have only little knowledge in python
beatifulsoup,
I have problem, please give the solution.
This is my html program
<body>
<p> This is paragraph </p>
<p> This is 2nd paragraph </p>
This is 3rd paragraph </p>
</body>
i need to get all the data of <p> ...</p>, but one of the starting
"<p>" tag is missing in html.
so i need to add <p> tags.
how to do this in python beatifulsoup
i have use prettify() function. but it removed the endtag "</p>" and
i get the o/p like
<body>
<p> This is paragraph </p>
<p> This is 2nd paragraph </p>
This is 3rd paragraph
</body>
but i need to get o/p as follows
<body>
<p> This is paragraph </p>
<p> This is 2nd paragraph </p>
<p> This is 3rd paragraph </p>
</body>
Thanks
C.Rajesh