# coding=utf-8
# 声明编码方式 默认编码方式ASCII 參考https://www.python.org/dev/peps/pep-0263/
import urllib
import time
import re
import os
'''
Python下载游迅网图片 BY:Eastmount
'''
'''
**************************************************
#第一步 遍历获取每页相应主题的URL
#http://pic.yxdown.com/list/0_0_1.html
#http://pic.yxdown.com/list/0_0_75.html
**************************************************
'''
fileurl=open('yxdown_url.txt','w')
fileurl.write('****************获取游讯网图片URL*************\n\n')
#建议num=3 while num<=3一次遍历一个页面全部主题,下次换成num=4 while num<=4而不是1-75
num=3
while num<=3:
temp = 'http://pic.yxdown.com/list/0_0_'+str(num)+'.html'
content = urllib.urlopen(temp).read()
open('yxdown_'+str(num)+'.html','w+').write(content)
print temp
fileurl.write('****************第'+str(num)+'页*************\n\n')
#爬取相应主题的URL
#
'm_div = re.findall(res_div,content,re.S|re.M)