0

Can I use libxml++ to parse html. I'm trying to find all the images in a xml file and store the image data directly into the src attribute of the web page.

I know there is a bit of a difference between html and xml that's why I am asking the question

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Talguy
0

This biterscripting script will extract images from a page.

# Script Img.txt
var str url
var str html, img
cat $url > $html
while ( { sen -c -r "^<img&src&=&\"&\"^" $html } > 0 )
do
    stex -c -r "^<img&src&=&\"^]" $html  > null
    stex "]^\"^" $html > $img
    echo $img
done

Save the script in file C:/Scripts/Img.txt, start biterscripting, enter this command.

script "C:/Scripts/Img.txt" url("http://www.daniweb.com/forums/thread261065.html#")

It will show you images on this page. I have tested this script. It's printing this output -

/alphaimages/misc/logo/logo.gif
/alphaimages/misc/logo/usercp.gif
/alphaimages/misc/logo/donate.gif
.
.
.

0

I'm not looking to use a scripting language. I was looking to have it coded in c/c++ and port into a mobile application.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.