Tuesday 5 January 2010

ie don't print filename

I needed to convert a webpage into a pdf today, and using PDFCreator, this is normally a doddle.

However, whenever I did, it printed the address to the footer of the page.

After much faffing around, I found that under the page setup are "headers" and "footers". If you delete what is in those fields, it stop ie and firefox printing the filenames and page numbers.

Monday 4 January 2010

XPath select attributes containing a string

I needed to find a way to use XPath to select items from within a html document, that would return back to me all UL tags that had an id that contained the word "menu".

To find all the UL's, it is simple enough to do:

//UL


However, to select the id of "menu", I then found:

//ul[@id='menu']


What I ended up with, to find any ULs that contained the word "menu" in the id attribute was:

//ul[contains(@id,'menu')]