爬取自己博客內容
阿新 • • 發佈:2018-01-19
res htm utf log logs one pytho utf8 true
#coding=utf-8 from bs4 import BeautifulSoup import urllib.request import re def validateTitle(title): rstr = r"[\/\\\:\*\?\"\<\>\|]" # ‘/ \ : * ? " < > |‘ new_title = re.sub(rstr, "_", title) # 替換為下劃線 return new_title #url = "http://www.cnblogs.com/php-linux/p/8318014.html" urls = [‘http://www.cnblogs.com/php-linux/p/8318014.html‘, ‘http://www.cnblogs.com/php-linux/p/8317777.html‘, ‘http://www.cnblogs.com/php-linux/p/8317101.html‘, ‘http://www.cnblogs.com/php-linux/p/8316709.html‘, ‘http://www.cnblogs.com/php-linux/p/8310794.html‘, ‘http://www.cnblogs.com/php-linux/p/8302962.html‘, ‘http://www.cnblogs.com/php-linux/p/8184470.html‘, ‘http://www.cnblogs.com/php-linux/p/8079529.html‘, ‘http://www.cnblogs.com/php-linux/p/8024883.html‘, ‘http://www.cnblogs.com/php-linux/p/8024855.html‘, ‘http://www.cnblogs.com/php-linux/p/8022388.html‘, ‘http://www.cnblogs.com/php-linux/p/8022108.html‘, ‘http://www.cnblogs.com/php-linux/p/8021917.html‘, ‘http://www.cnblogs.com/php-linux/p/8012262.html‘, ‘http://www.cnblogs.com/php-linux/p/8012174.html‘, ‘http://www.cnblogs.com/php-linux/p/8012079.html‘, ‘http://www.cnblogs.com/php-linux/p/8012072.html‘, ‘http://www.cnblogs.com/php-linux/p/8012029.html‘, ‘http://www.cnblogs.com/php-linux/p/8006100.html‘, ‘http://www.cnblogs.com/php-linux/p/8006060.html‘, ‘http://www.cnblogs.com/php-linux/p/8006041.html‘, ‘http://www.cnblogs.com/php-linux/p/8006035.html‘, ‘http://www.cnblogs.com/php-linux/p/8005837.html‘, ‘http://www.cnblogs.com/php-linux/p/8005799.html‘, ‘http://www.cnblogs.com/php-linux/p/8005649.html‘, ‘http://www.cnblogs.com/php-linux/p/8004276.html‘, ‘http://www.cnblogs.com/php-linux/p/7998582.html‘, ‘http://www.cnblogs.com/php-linux/p/7998566.html‘, ‘http://www.cnblogs.com/php-linux/p/7995155.html‘, ‘http://www.cnblogs.com/php-linux/p/7995084.html‘, ‘http://www.cnblogs.com/php-linux/p/7995050.html‘, ‘http://www.cnblogs.com/php-linux/p/7994812.html‘, ‘http://www.cnblogs.com/php-linux/p/7994615.html‘, ‘http://www.cnblogs.com/php-linux/p/7994193.html‘, ‘http://www.cnblogs.com/php-linux/p/7992597.html‘, ‘http://www.cnblogs.com/php-linux/p/7992106.html‘, ‘http://www.cnblogs.com/php-linux/p/7992083.html‘, ‘http://www.cnblogs.com/php-linux/p/7991966.html‘, ‘http://www.cnblogs.com/php-linux/p/7991884.html‘, ‘http://www.cnblogs.com/php-linux/p/7985948.html‘, ‘http://www.cnblogs.com/php-linux/p/7985839.html‘, ‘http://www.cnblogs.com/php-linux/p/7896222.html‘, ‘http://www.cnblogs.com/php-linux/p/7881514.html‘, ‘http://www.cnblogs.com/php-linux/p/7845687.html‘, ‘http://www.cnblogs.com/php-linux/p/7815962.html‘, ‘http://www.cnblogs.com/php-linux/p/7815917.html‘, ‘http://www.cnblogs.com/php-linux/p/7815901.html‘, ‘http://www.cnblogs.com/php-linux/p/7815752.html‘, ‘http://www.cnblogs.com/php-linux/p/7814795.html‘, ‘http://www.cnblogs.com/php-linux/p/7814658.html‘, ‘http://www.cnblogs.com/php-linux/p/7814412.html‘, ‘http://www.cnblogs.com/php-linux/p/7813833.html‘, ‘http://www.cnblogs.com/php-linux/p/7813755.html‘, ‘http://www.cnblogs.com/php-linux/p/7813734.html‘, ‘http://www.cnblogs.com/php-linux/p/7813351.html‘, ‘http://www.cnblogs.com/php-linux/p/7794334.html‘, ‘http://www.cnblogs.com/php-linux/p/7686411.html‘, ‘http://www.cnblogs.com/php-linux/p/7685952.html‘, ‘http://www.cnblogs.com/php-linux/p/7685949.html‘, ‘http://www.cnblogs.com/php-linux/p/7685894.html‘, ‘http://www.cnblogs.com/php-linux/p/7670941.html‘, ‘http://www.cnblogs.com/php-linux/p/7662393.html‘, ‘http://www.cnblogs.com/php-linux/p/7661614.html‘, ‘http://www.cnblogs.com/php-linux/p/7661586.html‘, ‘http://www.cnblogs.com/php-linux/p/7661566.html‘, ‘http://www.cnblogs.com/php-linux/p/7661528.html‘, ‘http://www.cnblogs.com/php-linux/p/7661516.html‘, ‘http://www.cnblogs.com/php-linux/p/7661509.html‘, ‘http://www.cnblogs.com/php-linux/p/7661504.html‘, ‘http://www.cnblogs.com/php-linux/p/7660190.html‘, ‘http://www.cnblogs.com/php-linux/p/7660174.html‘, ‘http://www.cnblogs.com/php-linux/p/7652718.html‘, ‘http://www.cnblogs.com/php-linux/p/7652706.html‘, ‘http://www.cnblogs.com/php-linux/p/7569984.html‘, ‘http://www.cnblogs.com/php-linux/p/7569962.html‘, ‘http://www.cnblogs.com/php-linux/p/7562939.html‘, ‘http://www.cnblogs.com/php-linux/p/7527603.html‘, ‘http://www.cnblogs.com/php-linux/p/7458610.html‘, ‘http://www.cnblogs.com/php-linux/p/7434513.html‘, ‘http://www.cnblogs.com/php-linux/p/7412564.html‘, ‘http://www.cnblogs.com/php-linux/p/7325853.html‘, ‘http://www.cnblogs.com/php-linux/p/7325728.html‘, ‘http://www.cnblogs.com/php-linux/p/7267844.html‘, ‘http://www.cnblogs.com/php-linux/p/7232868.html‘, ‘http://www.cnblogs.com/php-linux/p/7231741.html‘, ‘http://www.cnblogs.com/php-linux/p/7231669.html‘, ‘http://www.cnblogs.com/php-linux/p/7183342.html‘, ‘http://www.cnblogs.com/php-linux/p/7155909.html‘, ‘http://www.cnblogs.com/php-linux/p/7131377.html‘, ‘http://www.cnblogs.com/php-linux/p/7131316.html‘, ‘http://www.cnblogs.com/php-linux/p/7131270.html‘, ‘http://www.cnblogs.com/php-linux/p/7098793.html‘, ‘http://www.cnblogs.com/php-linux/p/7098741.html‘, ‘http://www.cnblogs.com/php-linux/p/7089438.html‘, ‘http://www.cnblogs.com/php-linux/p/7085871.html‘, ‘http://www.cnblogs.com/php-linux/p/7070865.html‘, ‘http://www.cnblogs.com/php-linux/p/7070679.html‘, ‘http://www.cnblogs.com/php-linux/p/7070452.html‘, ‘http://www.cnblogs.com/php-linux/p/7065548.html‘, ‘http://www.cnblogs.com/php-linux/p/7064707.html‘, ‘http://www.cnblogs.com/php-linux/p/7061121.html‘, ‘http://www.cnblogs.com/php-linux/p/7059770.html‘, ‘http://www.cnblogs.com/php-linux/p/7027716.html‘, ‘http://www.cnblogs.com/php-linux/p/6897395.html‘, ‘http://www.cnblogs.com/php-linux/p/6874566.html‘, ‘http://www.cnblogs.com/php-linux/p/6662181.html‘, ‘http://www.cnblogs.com/php-linux/p/6623479.html‘, ‘http://www.cnblogs.com/php-linux/p/6565268.html‘, ‘http://www.cnblogs.com/php-linux/p/6565195.html‘, ‘http://www.cnblogs.com/php-linux/p/6543206.html‘, ‘http://www.cnblogs.com/php-linux/p/6529944.html‘, ‘http://www.cnblogs.com/php-linux/p/6529775.html‘, ‘http://www.cnblogs.com/php-linux/p/6529432.html‘, ‘http://www.cnblogs.com/php-linux/p/6526641.html‘, ‘http://www.cnblogs.com/php-linux/p/6526481.html‘, ‘http://www.cnblogs.com/php-linux/p/6526284.html‘, ‘http://www.cnblogs.com/php-linux/p/6518548.html‘, ‘http://www.cnblogs.com/php-linux/p/6510299.html‘, ‘http://www.cnblogs.com/php-linux/p/6508753.html‘, ‘http://www.cnblogs.com/php-linux/p/6496886.html‘, ‘http://www.cnblogs.com/php-linux/p/6422847.html‘, ‘http://www.cnblogs.com/php-linux/p/6417342.html‘, ‘http://www.cnblogs.com/php-linux/p/6417143.html‘, ‘http://www.cnblogs.com/php-linux/p/6412165.html‘, ‘http://www.cnblogs.com/php-linux/p/6387503.html‘, ‘http://www.cnblogs.com/php-linux/p/6386973.html‘, ‘http://www.cnblogs.com/php-linux/p/6379415.html‘, ‘http://www.cnblogs.com/php-linux/p/6377265.html‘, ‘http://www.cnblogs.com/php-linux/p/6370315.html‘, ‘http://www.cnblogs.com/php-linux/p/6366048.html‘, ‘http://www.cnblogs.com/php-linux/p/6365978.html‘, ‘http://www.cnblogs.com/php-linux/p/6365941.html‘, ‘http://www.cnblogs.com/php-linux/p/6306961.html‘, ‘http://www.cnblogs.com/php-linux/p/jquery.html‘, ‘http://www.cnblogs.com/php-linux/p/6305979.html‘, ‘http://www.cnblogs.com/php-linux/p/6305554.html‘, ‘http://www.cnblogs.com/php-linux/p/6272852.html‘, ‘http://www.cnblogs.com/php-linux/p/6272633.html‘, ‘http://www.cnblogs.com/php-linux/p/6265797.html‘, ‘http://www.cnblogs.com/php-linux/p/6265427.html‘, ‘http://www.cnblogs.com/php-linux/p/6264674.html‘, ‘http://www.cnblogs.com/php-linux/p/6249569.html‘, ‘http://www.cnblogs.com/php-linux/p/6248183.html‘, ‘http://www.cnblogs.com/php-linux/p/6248097.html‘, ‘http://www.cnblogs.com/php-linux/p/6248058.html‘, ‘http://www.cnblogs.com/php-linux/p/6247853.html‘, ‘http://www.cnblogs.com/php-linux/p/6247846.html‘, ‘http://www.cnblogs.com/php-linux/p/6246596.html‘, ‘http://www.cnblogs.com/php-linux/p/6246559.html‘, ‘http://www.cnblogs.com/php-linux/p/6246528.html‘, ‘http://www.cnblogs.com/php-linux/p/6246506.html‘, ‘http://www.cnblogs.com/php-linux/p/6232270.html‘, ‘http://www.cnblogs.com/php-linux/p/6208610.html‘, ‘http://www.cnblogs.com/php-linux/p/6197550.html‘, ‘http://www.cnblogs.com/php-linux/p/6197406.html‘, ‘http://www.cnblogs.com/php-linux/p/6193251.html‘, ‘http://www.cnblogs.com/php-linux/p/6193253.html‘, ‘http://www.cnblogs.com/php-linux/p/6187641.html‘, ‘http://www.cnblogs.com/php-linux/p/6187316.html‘, ‘http://www.cnblogs.com/php-linux/p/6186730.html‘, ‘http://www.cnblogs.com/php-linux/p/6185817.html‘, ‘http://www.cnblogs.com/php-linux/p/6185760.html‘, ‘http://www.cnblogs.com/php-linux/p/6179442.html‘, ‘http://www.cnblogs.com/php-linux/p/6179289.html‘, ‘http://www.cnblogs.com/php-linux/p/6179188.html‘, ‘http://www.cnblogs.com/php-linux/p/6150650.html‘, ‘http://www.cnblogs.com/php-linux/p/6150558.html‘, ‘http://www.cnblogs.com/php-linux/p/6149602.html‘, ‘http://www.cnblogs.com/php-linux/p/6149420.html‘, ‘http://www.cnblogs.com/php-linux/p/6149398.html‘, ‘http://www.cnblogs.com/php-linux/p/6141431.html‘, ‘http://www.cnblogs.com/php-linux/p/6139963.html‘, ‘http://www.cnblogs.com/php-linux/p/6138698.html‘, ‘http://www.cnblogs.com/php-linux/p/re.html‘, ‘http://www.cnblogs.com/php-linux/p/6138595.html‘, ‘http://www.cnblogs.com/php-linux/p/6138527.html‘, ‘http://www.cnblogs.com/php-linux/p/6135546.html‘, ‘http://www.cnblogs.com/php-linux/p/6134294.html‘, ‘http://www.cnblogs.com/php-linux/p/6124515.html‘, ‘http://www.cnblogs.com/php-linux/p/6123527.html‘, ‘http://www.cnblogs.com/php-linux/p/6122088.html‘, ‘http://www.cnblogs.com/php-linux/p/6122072.html‘, ‘http://www.cnblogs.com/php-linux/p/6121370.html‘, ‘http://www.cnblogs.com/php-linux/p/6121336.html‘, ‘http://www.cnblogs.com/php-linux/p/6121309.html‘, ‘http://www.cnblogs.com/php-linux/p/6120637.html‘, ‘http://www.cnblogs.com/php-linux/p/6120274.html‘, ‘http://www.cnblogs.com/php-linux/p/6117840.html‘, ‘http://www.cnblogs.com/php-linux/p/python.html‘, ‘http://www.cnblogs.com/php-linux/p/6115894.html‘, ‘http://www.cnblogs.com/php-linux/p/6115815.html‘, ‘http://www.cnblogs.com/php-linux/p/6115808.html‘, ‘http://www.cnblogs.com/php-linux/p/6115804.html‘, ‘http://www.cnblogs.com/php-linux/p/6115794.html‘, ‘http://www.cnblogs.com/php-linux/p/6115798.html‘, ‘http://www.cnblogs.com/php-linux/p/6115709.html‘, ‘http://www.cnblogs.com/php-linux/p/6115542.html‘, ‘http://www.cnblogs.com/php-linux/p/6115506.html‘, ‘http://www.cnblogs.com/php-linux/p/6112238.html‘, ‘http://www.cnblogs.com/php-linux/p/6110792.html‘, ‘http://www.cnblogs.com/php-linux/p/6103639.html‘, ‘http://www.cnblogs.com/php-linux/p/6103423.html‘, ‘http://www.cnblogs.com/php-linux/p/6103273.html‘, ‘http://www.cnblogs.com/php-linux/p/6089845.html‘, ‘http://www.cnblogs.com/php-linux/p/6089910.html‘, ‘http://www.cnblogs.com/php-linux/p/6088989.html‘, ‘http://www.cnblogs.com/php-linux/p/6088986.html‘, ‘http://www.cnblogs.com/php-linux/p/6088813.html‘, ‘http://www.cnblogs.com/php-linux/p/6088381.html‘, ‘http://www.cnblogs.com/php-linux/p/6088282.html‘, ‘http://www.cnblogs.com/php-linux/p/6088144.html‘, ‘http://www.cnblogs.com/php-linux/p/6088011.html‘, ‘http://www.cnblogs.com/php-linux/p/6086404.html‘, ‘http://www.cnblogs.com/php-linux/p/6085397.html‘, ‘http://www.cnblogs.com/php-linux/p/6085306.html‘, ‘http://www.cnblogs.com/php-linux/p/6075864.html‘, ‘http://www.cnblogs.com/php-linux/p/6075859.html‘, ‘http://www.cnblogs.com/php-linux/p/6075846.html‘, ‘http://www.cnblogs.com/php-linux/p/6075840.html‘, ‘http://www.cnblogs.com/php-linux/p/6028916.html‘, ‘http://www.cnblogs.com/php-linux/p/6028902.html‘, ‘http://www.cnblogs.com/php-linux/p/6028273.html‘, ‘http://www.cnblogs.com/php-linux/p/6028184.html‘, ‘http://www.cnblogs.com/php-linux/p/6027342.html‘, ‘http://www.cnblogs.com/php-linux/p/6021762.html‘, ‘http://www.cnblogs.com/php-linux/p/6021740.html‘, ‘http://www.cnblogs.com/php-linux/p/6018625.html‘, ‘http://www.cnblogs.com/php-linux/p/6018301.html‘, ‘http://www.cnblogs.com/php-linux/p/6016439.html‘, ‘http://www.cnblogs.com/php-linux/p/6002899.html‘, ‘http://www.cnblogs.com/php-linux/p/6002672.html‘, ‘http://www.cnblogs.com/php-linux/p/6002673.html‘, ‘http://www.cnblogs.com/php-linux/p/6002665.html‘, ‘http://www.cnblogs.com/php-linux/p/6002663.html‘, ‘http://www.cnblogs.com/php-linux/p/6002664.html‘, ‘http://www.cnblogs.com/php-linux/p/6002659.html‘, ‘http://www.cnblogs.com/php-linux/p/6002657.html‘, ‘http://www.cnblogs.com/php-linux/p/6002656.html‘, ‘http://www.cnblogs.com/php-linux/p/5967033.html‘, ‘http://www.cnblogs.com/php-linux/p/5966556.html‘, ‘http://www.cnblogs.com/php-linux/p/5966509.html‘, ‘http://www.cnblogs.com/php-linux/p/5966499.html‘, ‘http://www.cnblogs.com/php-linux/p/5966014.html‘, ‘http://www.cnblogs.com/php-linux/p/5962561.html‘, ‘http://www.cnblogs.com/php-linux/p/5962560.html‘, ‘http://www.cnblogs.com/php-linux/p/5962168.html‘, ‘http://www.cnblogs.com/php-linux/p/5941007.html‘, ‘http://www.cnblogs.com/php-linux/p/5919396.html‘, ‘http://www.cnblogs.com/php-linux/p/5883815.html‘, ‘http://www.cnblogs.com/php-linux/p/5759844.html‘, ‘http://www.cnblogs.com/php-linux/p/5682001.html‘, ‘http://www.cnblogs.com/php-linux/p/5681894.html‘, ‘http://www.cnblogs.com/php-linux/p/5681836.html‘, ‘http://www.cnblogs.com/php-linux/p/5681582.html‘, ‘http://www.cnblogs.com/php-linux/p/5673591.html‘, ‘http://www.cnblogs.com/php-linux/p/5673504.html‘, ‘http://www.cnblogs.com/php-linux/p/5673328.html‘, ‘http://www.cnblogs.com/php-linux/p/5669822.html‘, ‘http://www.cnblogs.com/php-linux/p/5613546.html‘, ‘http://www.cnblogs.com/php-linux/p/5590005.html‘, ‘http://www.cnblogs.com/php-linux/p/5569609.html‘, ‘http://www.cnblogs.com/php-linux/p/5567801.html‘, ‘http://www.cnblogs.com/php-linux/p/5567681.html‘, ‘http://www.cnblogs.com/php-linux/p/5567548.html‘, ‘http://www.cnblogs.com/php-linux/p/5567527.html‘, ‘http://www.cnblogs.com/php-linux/p/5567524.html‘, ‘http://www.cnblogs.com/php-linux/p/5567274.html‘, ‘http://www.cnblogs.com/php-linux/p/5567184.html‘, ‘http://www.cnblogs.com/php-linux/p/5552803.html‘, ‘http://www.cnblogs.com/php-linux/p/5552791.html‘, ‘http://www.cnblogs.com/php-linux/p/5552679.html‘, ‘http://www.cnblogs.com/php-linux/p/5552509.html‘, ‘http://www.cnblogs.com/php-linux/p/5552497.html‘, ‘http://www.cnblogs.com/php-linux/p/5551841.html‘, ‘http://www.cnblogs.com/php-linux/p/5548460.html‘, ‘http://www.cnblogs.com/php-linux/p/5545846.html‘, ‘http://www.cnblogs.com/php-linux/p/5545690.html‘, ‘http://www.cnblogs.com/php-linux/p/5512259.html‘, ‘http://www.cnblogs.com/php-linux/p/5502412.html‘, ‘http://www.cnblogs.com/php-linux/p/5480699.html‘, ‘http://www.cnblogs.com/php-linux/p/5475432.html‘, ‘http://www.cnblogs.com/php-linux/p/5466683.html‘, ‘http://www.cnblogs.com/php-linux/p/5465829.html‘, ‘http://www.cnblogs.com/php-linux/p/5465401.html‘, ‘http://www.cnblogs.com/php-linux/p/5465394.html‘, ‘http://www.cnblogs.com/php-linux/p/5449074.html‘, ‘http://www.cnblogs.com/php-linux/p/5449071.html‘, ‘http://www.cnblogs.com/php-linux/p/5448920.html‘, ‘http://www.cnblogs.com/php-linux/p/5448912.html‘, ‘http://www.cnblogs.com/php-linux/p/5448897.html‘, ‘http://www.cnblogs.com/php-linux/p/5448853.html‘, ‘http://www.cnblogs.com/php-linux/p/5448707.html‘, ‘http://www.cnblogs.com/php-linux/p/5448659.html‘, ‘http://www.cnblogs.com/php-linux/p/5446332.html‘, ‘http://www.cnblogs.com/php-linux/p/5445927.html‘, ‘http://www.cnblogs.com/php-linux/p/5437642.html‘, ‘http://www.cnblogs.com/php-linux/p/5437582.html‘, ‘http://www.cnblogs.com/php-linux/p/5437537.html‘, ‘http://www.cnblogs.com/php-linux/p/5435853.html‘, ‘http://www.cnblogs.com/php-linux/p/5432999.html‘, ‘http://www.cnblogs.com/php-linux/p/5431683.html‘, ‘http://www.cnblogs.com/php-linux/p/5431573.html‘, ‘http://www.cnblogs.com/php-linux/p/5424085.html‘, ‘http://www.cnblogs.com/php-linux/p/5421422.html‘, ‘http://www.cnblogs.com/php-linux/p/5421196.html‘, ‘http://www.cnblogs.com/php-linux/p/5421191.html‘, ‘http://www.cnblogs.com/php-linux/p/5420966.html‘, ‘http://www.cnblogs.com/php-linux/p/5420953.html‘, ‘http://www.cnblogs.com/php-linux/p/5416518.html‘, ‘http://www.cnblogs.com/php-linux/p/5416514.html‘, ‘http://www.cnblogs.com/php-linux/p/5414208.html‘, ‘http://www.cnblogs.com/php-linux/p/5414190.html‘, ‘http://www.cnblogs.com/php-linux/p/5408032.html‘, ‘http://www.cnblogs.com/php-linux/p/5407837.html‘, ‘http://www.cnblogs.com/php-linux/p/5399049.html‘, ‘http://www.cnblogs.com/php-linux/p/5398909.html‘, ‘http://www.cnblogs.com/php-linux/p/5398883.html‘, ‘http://www.cnblogs.com/php-linux/p/5398849.html‘, ‘http://www.cnblogs.com/php-linux/p/5392072.html‘, ‘http://www.cnblogs.com/php-linux/p/5375067.html‘, ‘http://www.cnblogs.com/php-linux/p/5374943.html‘, ‘http://www.cnblogs.com/php-linux/p/5374945.html‘, ‘http://www.cnblogs.com/php-linux/p/5374835.html‘, ‘http://www.cnblogs.com/php-linux/p/5373253.html‘, ‘http://www.cnblogs.com/php-linux/p/5372296.html‘, ‘http://www.cnblogs.com/php-linux/p/5372255.html‘, ‘http://www.cnblogs.com/php-linux/p/5372007.html‘, ‘http://www.cnblogs.com/php-linux/p/5367738.html‘, ‘http://www.cnblogs.com/php-linux/p/5361684.html‘, ‘http://www.cnblogs.com/php-linux/p/5358547.html‘, ‘http://www.cnblogs.com/php-linux/p/5358025.html‘, ‘http://www.cnblogs.com/php-linux/p/5357157.html‘, ‘http://www.cnblogs.com/php-linux/p/5356907.html‘, ‘http://www.cnblogs.com/php-linux/p/5356877.html‘, ‘http://www.cnblogs.com/php-linux/p/5352766.html‘, ‘http://www.cnblogs.com/php-linux/p/5349773.html‘, ‘http://www.cnblogs.com/php-linux/p/5349771.html‘, ‘http://www.cnblogs.com/php-linux/p/5349768.html‘, ‘http://www.cnblogs.com/php-linux/p/5349770.html‘, ‘http://www.cnblogs.com/php-linux/p/5349767.html‘, ‘http://www.cnblogs.com/php-linux/p/5349763.html‘, ‘http://www.cnblogs.com/php-linux/p/5349198.html‘, ‘http://www.cnblogs.com/php-linux/p/5347931.html‘, ‘http://www.cnblogs.com/php-linux/p/5322344.html‘, ‘http://www.cnblogs.com/php-linux/p/5313461.html‘, ‘http://www.cnblogs.com/php-linux/p/5313313.html‘, ‘http://www.cnblogs.com/php-linux/p/5291287.html‘, ‘http://www.cnblogs.com/php-linux/p/5281671.html‘, ‘http://www.cnblogs.com/php-linux/p/5280892.html‘, ‘http://www.cnblogs.com/php-linux/p/5274832.html‘, ‘http://www.cnblogs.com/php-linux/p/5274830.html‘, ‘http://www.cnblogs.com/php-linux/p/5267489.html‘, ‘http://www.cnblogs.com/php-linux/p/5267487.html‘, ‘http://www.cnblogs.com/php-linux/p/5264103.html‘, ‘http://www.cnblogs.com/php-linux/p/5262077.html‘, ‘http://www.cnblogs.com/php-linux/p/5258208.html‘, ‘http://www.cnblogs.com/php-linux/p/5252942.html‘, ‘http://www.cnblogs.com/php-linux/p/5252910.html‘, ‘http://www.cnblogs.com/php-linux/p/5252791.html‘, ‘http://www.cnblogs.com/php-linux/p/5229909.html‘, ‘http://www.cnblogs.com/php-linux/p/5229792.html‘, ‘http://www.cnblogs.com/php-linux/p/5227592.html‘, ‘http://www.cnblogs.com/php-linux/p/5221076.html‘, ‘http://www.cnblogs.com/php-linux/p/5220704.html‘, ‘http://www.cnblogs.com/php-linux/p/5220693.html‘, ‘http://www.cnblogs.com/php-linux/p/5220599.html‘, ‘http://www.cnblogs.com/php-linux/p/5220565.html‘, ‘http://www.cnblogs.com/php-linux/p/5220556.html‘, ‘http://www.cnblogs.com/php-linux/p/5220546.html‘, ‘http://www.cnblogs.com/php-linux/p/5220467.html‘, ‘http://www.cnblogs.com/php-linux/p/5219653.html‘, ‘http://www.cnblogs.com/php-linux/p/5219507.html‘, ‘http://www.cnblogs.com/php-linux/p/5219423.html‘, ‘http://www.cnblogs.com/php-linux/p/5205887.html‘, ‘http://www.cnblogs.com/php-linux/p/5190842.html‘, ‘http://www.cnblogs.com/php-linux/p/5190797.html‘, ‘http://www.cnblogs.com/php-linux/p/5190794.html‘, ‘http://www.cnblogs.com/php-linux/p/5082625.html‘, ‘http://www.cnblogs.com/php-linux/p/5073275.html‘, ‘http://www.cnblogs.com/php-linux/p/5033958.html‘, ‘http://www.cnblogs.com/php-linux/p/5031528.html‘, ‘http://www.cnblogs.com/php-linux/p/5031416.html‘, ‘http://www.cnblogs.com/php-linux/p/5031352.html‘, ‘http://www.cnblogs.com/php-linux/p/5031343.html‘, ‘http://www.cnblogs.com/php-linux/p/5031311.html‘, ‘http://www.cnblogs.com/php-linux/p/5031307.html‘, ‘http://www.cnblogs.com/php-linux/p/5031250.html‘, ‘http://www.cnblogs.com/php-linux/p/5018573.html‘, ‘http://www.cnblogs.com/php-linux/p/5018570.html‘, ‘http://www.cnblogs.com/php-linux/p/5011963.html‘, ‘http://www.cnblogs.com/php-linux/p/5011960.html‘, ‘http://www.cnblogs.com/php-linux/p/5009193.html‘, ‘http://www.cnblogs.com/php-linux/p/5008561.html‘, ‘http://www.cnblogs.com/php-linux/p/5008556.html‘, ‘http://www.cnblogs.com/php-linux/p/5008559.html‘, ‘http://www.cnblogs.com/php-linux/p/5005351.html‘, ‘http://www.cnblogs.com/php-linux/p/5000487.html‘, ‘http://www.cnblogs.com/php-linux/p/4993412.html‘, ‘http://www.cnblogs.com/php-linux/p/4993392.html‘, ‘http://www.cnblogs.com/php-linux/p/4993344.html‘, ‘http://www.cnblogs.com/php-linux/p/4993265.html‘, ‘http://www.cnblogs.com/php-linux/p/4993167.html‘, ‘http://www.cnblogs.com/php-linux/p/4993122.html‘, ‘http://www.cnblogs.com/php-linux/p/4991874.html‘, ‘http://www.cnblogs.com/php-linux/p/4990721.html‘, ‘http://www.cnblogs.com/php-linux/p/4978355.html‘, ‘http://www.cnblogs.com/php-linux/p/4978340.html‘, ‘http://www.cnblogs.com/php-linux/p/4978336.html‘, ‘http://www.cnblogs.com/php-linux/p/4960716.html‘, ‘http://www.cnblogs.com/php-linux/p/4958048.html‘, ‘http://www.cnblogs.com/php-linux/p/4955544.html‘, ‘http://www.cnblogs.com/php-linux/p/4954807.html‘, ‘http://www.cnblogs.com/php-linux/p/4951595.html‘, ‘http://www.cnblogs.com/php-linux/p/4951468.html‘, ‘http://www.cnblogs.com/php-linux/p/4951386.html‘, ‘http://www.cnblogs.com/php-linux/p/4947283.html‘, ‘http://www.cnblogs.com/php-linux/p/4934806.html‘, ‘http://www.cnblogs.com/php-linux/p/4932832.html‘, ‘http://www.cnblogs.com/php-linux/p/4929381.html‘, ‘http://www.cnblogs.com/php-linux/p/4921708.html‘, ‘http://www.cnblogs.com/php-linux/p/4915960.html‘, ‘http://www.cnblogs.com/php-linux/p/4777367.html‘, ‘http://www.cnblogs.com/php-linux/p/4762959.html‘, ‘http://www.cnblogs.com/php-linux/p/4762957.html‘, ‘http://www.cnblogs.com/php-linux/p/4748231.html‘, ‘http://www.cnblogs.com/php-linux/p/4742259.html‘, ‘http://www.cnblogs.com/php-linux/p/4736589.html‘, ‘http://www.cnblogs.com/php-linux/p/4730744.html‘, ‘http://www.cnblogs.com/php-linux/p/4730329.html‘, ‘http://www.cnblogs.com/php-linux/p/4730322.html‘, ‘http://www.cnblogs.com/php-linux/p/4730240.html‘, ‘http://www.cnblogs.com/php-linux/p/4718179.html‘, ‘http://www.cnblogs.com/php-linux/p/4717446.html‘, ‘http://www.cnblogs.com/php-linux/p/4666424.html‘, ‘http://www.cnblogs.com/php-linux/p/4608373.html‘, ‘http://www.cnblogs.com/php-linux/p/4606723.html‘, ‘http://www.cnblogs.com/php-linux/p/4598360.html‘, ‘http://www.cnblogs.com/php-linux/p/4598299.html‘, ‘http://www.cnblogs.com/php-linux/p/4598066.html‘, ‘http://www.cnblogs.com/php-linux/p/4597886.html‘, ‘http://www.cnblogs.com/php-linux/p/4597758.html‘, ‘http://www.cnblogs.com/php-linux/p/4597742.html‘, ‘http://www.cnblogs.com/php-linux/p/4597730.html‘, ‘http://www.cnblogs.com/php-linux/p/4597680.html‘, ‘http://www.cnblogs.com/php-linux/p/4597640.html‘, ‘http://www.cnblogs.com/php-linux/p/4597627.html‘, ‘http://www.cnblogs.com/php-linux/p/4597591.html‘, ‘http://www.cnblogs.com/php-linux/p/4597376.html‘, ‘http://www.cnblogs.com/php-linux/p/4597349.html‘, ‘http://www.cnblogs.com/php-linux/p/4597262.html‘, ‘http://www.cnblogs.com/php-linux/p/4597196.html‘, ‘http://www.cnblogs.com/php-linux/p/4597097.html‘, ‘http://www.cnblogs.com/php-linux/p/4597060.html‘, ‘http://www.cnblogs.com/php-linux/p/4596083.html‘, ‘http://www.cnblogs.com/php-linux/p/4596078.html‘, ‘http://www.cnblogs.com/php-linux/p/4596053.html‘, ‘http://www.cnblogs.com/php-linux/p/4595999.html‘, ‘http://www.cnblogs.com/php-linux/p/4580291.html‘, ‘http://www.cnblogs.com/php-linux/p/4576408.html‘, ‘http://www.cnblogs.com/php-linux/p/4576382.html‘, ‘http://www.cnblogs.com/php-linux/p/4568262.html‘, ‘http://www.cnblogs.com/php-linux/p/4565147.html‘, ‘http://www.cnblogs.com/php-linux/p/4563696.html‘, ‘http://www.cnblogs.com/php-linux/p/4562771.html‘, ‘http://www.cnblogs.com/php-linux/p/4561285.html‘, ‘http://www.cnblogs.com/php-linux/p/4561284.html‘, ‘http://www.cnblogs.com/php-linux/p/4561018.html‘, ‘http://www.cnblogs.com/php-linux/p/4560800.html‘, ‘http://www.cnblogs.com/php-linux/p/4560776.html‘, ‘http://www.cnblogs.com/php-linux/p/4560117.html‘, ‘http://www.cnblogs.com/php-linux/p/4549685.html‘, ‘http://www.cnblogs.com/php-linux/p/4549392.html‘, ‘http://www.cnblogs.com/php-linux/p/4549221.html‘, ‘http://www.cnblogs.com/php-linux/p/4549204.html‘, ‘http://www.cnblogs.com/php-linux/p/4530029.html‘, ‘http://www.cnblogs.com/php-linux/p/4529970.html‘, ‘http://www.cnblogs.com/php-linux/p/4529876.html‘, ‘http://www.cnblogs.com/php-linux/p/4529839.html‘, ‘http://www.cnblogs.com/php-linux/p/4523743.html‘, ‘http://www.cnblogs.com/php-linux/p/4516470.html‘, ‘http://www.cnblogs.com/php-linux/p/4516465.html‘, ‘http://www.cnblogs.com/php-linux/p/4505361.html‘, ‘http://www.cnblogs.com/php-linux/p/4476101.html‘, ‘http://www.cnblogs.com/php-linux/p/4459739.html‘, ‘http://www.cnblogs.com/php-linux/p/4459312.html‘, ‘http://www.cnblogs.com/php-linux/p/4458922.html‘, ‘http://www.cnblogs.com/php-linux/p/4458920.html‘, ‘http://www.cnblogs.com/php-linux/p/4458919.html‘, ‘http://www.cnblogs.com/php-linux/p/4458918.html‘, ‘http://www.cnblogs.com/php-linux/p/4455616.html‘, ‘http://www.cnblogs.com/php-linux/p/4454128.html‘, ‘http://www.cnblogs.com/php-linux/p/4453846.html‘, ‘http://www.cnblogs.com/php-linux/p/4450545.html‘, ‘http://www.cnblogs.com/php-linux/p/4448144.html‘, ‘http://www.cnblogs.com/php-linux/p/4446797.html‘, ‘http://www.cnblogs.com/php-linux/p/4446596.html‘, ‘http://www.cnblogs.com/php-linux/p/4446442.html‘, ‘http://www.cnblogs.com/php-linux/p/4446386.html‘, ‘http://www.cnblogs.com/php-linux/p/4438666.html‘, ‘http://www.cnblogs.com/php-linux/p/4434910.html‘, ‘http://www.cnblogs.com/php-linux/p/4404803.html‘, ‘http://www.cnblogs.com/php-linux/p/4403049.html‘, ‘http://www.cnblogs.com/php-linux/p/4402001.html‘, ‘http://www.cnblogs.com/php-linux/p/4391269.html‘, ‘http://www.cnblogs.com/php-linux/p/4389404.html‘, ‘http://www.cnblogs.com/php-linux/p/4388833.html‘, ‘http://www.cnblogs.com/php-linux/p/4388820.html‘, ‘http://www.cnblogs.com/php-linux/p/4388815.html‘, ‘http://www.cnblogs.com/php-linux/p/4388811.html‘, ‘http://www.cnblogs.com/php-linux/p/4388806.html‘, ‘http://www.cnblogs.com/php-linux/p/4388804.html‘, ‘http://www.cnblogs.com/php-linux/p/4388684.html‘, ‘http://www.cnblogs.com/php-linux/p/4388632.html‘, ‘http://www.cnblogs.com/php-linux/p/4388595.html‘, ‘http://www.cnblogs.com/php-linux/p/4388543.html‘, ‘http://www.cnblogs.com/php-linux/p/4386763.html‘, ‘http://www.cnblogs.com/php-linux/p/4386757.html‘, ‘http://www.cnblogs.com/php-linux/p/4386469.html‘, ‘http://www.cnblogs.com/php-linux/p/4386347.html‘, ‘http://www.cnblogs.com/php-linux/p/4386185.html‘, ‘http://www.cnblogs.com/php-linux/p/4386041.html‘, ‘http://www.cnblogs.com/php-linux/p/4385928.html‘, ‘http://www.cnblogs.com/php-linux/p/4385873.html‘] #urls = [‘http://www.cnblogs.com/php-linux/p/6018301.html‘] for url in urls: print(url) res = urllib.request.urlopen(url) soup = BeautifulSoup(res,‘lxml‘) book_div = soup.find(attrs={‘id‘:"topics"}) if book_div != None: title = book_div.find(attrs={"id":‘cb_post_title_url‘}) content = book_div.find(attrs={"id":"post_body"}) file_name = str(title.string)[0:20] file_name = validateTitle(file_name)+".txt" f = open(file_name,"w",encoding=‘utf8‘) f.write(str(title.string) + "\n"+str(content.get_text())+"\n") f.close() print("保存成功")
爬取自己博客內容