I have a feed.xml file that looks something like this. What I want to do is to grab the test.html from this feed.(Basically, the top most item’s url.) Any thoughts on how to do this?
<rss>
<item>
<title>ABC</title>
<url>
test.html
</url>
</item>
<item>
<title>CDE</title>
<url>
test1.html
</url>
</item>
</rss>
Thanks!
If the structure is fixed and you know that the URL has the postfix .html, you can simply do:
If you don’t know the postfix (or the string “html” can exist before), you can do:
EDIT
In case, the structure is not fixed (i.e., no newlines), there this
or that
may work.