hello,
I'v raw html derived with BeautifulSoup from another webpage,
which I want insert in the contents of the web.
The images in the orginal webpage are located in the same directory as the html
page.
The orginal webpage is moved to a database,
and the images are placed into the web2py application's static/images/...
Now I encounter 2 problems:
1. the raw html contains tags, like:
<p>toch iets over stromen, een plaatje</p><p><br /></p><br
/><p>
I "remove" them with the helper function TAG.
Although it seems to work, I'm not convinced that this is the right method.
Is this the correct way ?
Are there better ways ?
The second problem is the image locations:
<p><img width="307" height="244" alt="" src="veiligheid_website_img1.jpg"
/></p>
I change the image location with, not a neat way, but it works.
Any better ways ?
Result = DIV ()
Result.append ( H2 ( Book + ', ' + Chapter ) )
Result.append ( H3 ( Paragraph ) )
Text = Text.replace ( 'src="', 'src="/E_Veiligheid/static/images/' )
Result.append ( TAG ( Text ) )
thanks,
Stef Mientki