Search (including novel url, name, author's last name), download to TXT text
# download moduleSearch_real_url='https://www.biquge5200.com/modules/article/search.php? Searchkey + book_name='
Try:
Novel_source=requests. Get (search_real_url). The text
Reg1=r '& lt; Td & gt; . *? ' # all results (including novel url, name, author's last name) Novel_list=re. The.findall (reg1, novel_source, re S) # judge whether there is data back If len (novel_list)==0: Print (' search less than you want to novel ') Except the Exception as e: Print (e) For novel_url novel_name, novel_author novel_list in: If novel_name==book_name: Print (' author title: % s: % s' % (novel_name novel_author)) Return novel_url, novel_name
|