Use python + xpath to get the download link
Use python + xpath to obtain external <table class = "list">... </table> and obtain the content in <tr class = "odd"> and <tr class = "even"> respectively, when using xpath, you can write xpath ('// table [@ class = "list"]/tr [@ class = "even" or "odd"]/td/span/[ 1]/@ href ') import reimport requestsimport urllib2from lxml import etree url = 'https: // pypi.python.org/pypi/lxml/2.3/'head?='user-agent':'mozilla /5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/100'} def gethtml (url, * args): html = requests. get (url, * args ). content return html def writfile (cont): try: fd = open('x.txt ', 'w') try: fd. write (cont) finally: fd. close () handle T IOError: print "file not existing! "Def readfile (): try: fd = open('x.txt ', 'R') try: all_the_text = fd. read () finally: fd. close () handle T IOError: print "File open error! "Return all_the_text html = gethtml (url, head) writfile (html) all_text = readfile () dom = etree. HTML (all_text) url_list = dom. xpath ('// table [@ class = "list"]/tr [@ class = "even" or "odd"]/td/span/a [1]/@ href ') for url in url_list: print url after testing, you can get the corresponding download link normally. As a beginner, there are many improper aspects of the Code. Please refer to the code after reading it.