电影天堂种子搜索

import request,re
      for i in range(1,177)
           url = 'http://www.ygdy8.net/html/gndy/dyzz/list_23_{}.html'.format(i)
          try:
               response = request.get(url)
          except:
              print("获取异常")           
          response.encoding= 'gb2312'
          movie_list = re.findall('.*?',response.text)
              for u in movie_list:
                  url = "http://www.ygdy8.net" + u
                  response = request.get(url)
                  response.encoding= 'gb2312'   
                  ftp_url = re.findall(' .*?')
                  with open('./movie.txt','ab') as f:
                          f.write(ftp_url)
                   f.close()

你可能感兴趣的:(电影天堂种子搜索)