views:

76

answers:

2

Some web pages, having their urls, have "Download" Text, which are hyperlinks.

How can I get the hyperlinks form the urls/pages by python or ironpython.

And can I download the files with these hyperlinks by python or ironpython? How can I do that?

Are there any C# tools?

I am not native english speaker, so sorry for my english.

+1  A: 

The easiest way would be to pass the HTML page into an XML/HTML parser, and then call getElementsByTagName("A") on the root node. Once you get that, iterate through the list and pull out the href parameter.

bluesmoon
+2  A: 

You should be able to use the BeautifulSoup library with CPython (normal Python) and IronPython. Check out the findAll() method. This should pull out a list of all the links.

soup.findAll('a')
BrianLy
Beautiful Soup 中文文档 http://www.crummy.com/software/BeautifulSoup/documentation.zh.html
jcao219