真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

python超簡化的18行代碼爬一本小說

import urllib.request
import re
def getnvvel():
html = urllib.request.urlopen("http://www.quanshuwang.com/book/44/44683").read().decode('gbk') # download sould code
urls = re.findall(r'

  • (.?)
  • ', html) # regular expression
    title = "douluo" # Normoally,you should use request.urlopen
    f = open('../novel/%s.txt' % title, 'w') # create a douluo.txt
    for url in urls:
    chapter_url = url[0]
    chapter_title = url[1]
    chapter_content_list = urllib.request.urlopen(chapter_url).read().decode("gbk")
    chapter_content_list = re.findall(r'    .
    ?
    (.*?)