selecting divs fails
See the question and my original answer on StackOverflowAll your XPATH expressions start with '//' which means "start from root of the document and search recursively". So when you do this:
link.SelectSingleNode("//div[@class='mlink']//span[@class='argmore']//a[@href]")
You will start not from link
, but from the document's root. You probably want to do this instead:
link.SelectSingleNode("div[@class='mlink']...etc...")
which is equivalent to
link.SelectSingleNode("./div[@class='mlink']...etc...")
'.' means the current node. '/' means search only the direct children, not recursively.