⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40#!python -m pip install requests beautifulsoup4 import requests,re from bs4 import BeautifulSoup from urllib.parse import urlsplit url = 'https://13dl.me/list/popular/' counter = 0 def scrape(url,counter): next_url = "" response = requests.get(url) if response.status_code == 200: soup = BeautifulSoup(response.content) response.close() xx = soup.find_all("a",title=True) del soup if xx: for x in xx: if (x['title'] != '' and x['title'] != "Home" and x['title'] != "Popular Manga"): pa_tf = bool(re.search(r'^Page',x['title'])) p_tf = bool(re.search(r'^Prev',x['title'])) if (pa_tf == False and p_tf == False): if (x['title'] != "Next"): counter += 1 print(counter,x['title']) thumnail_addr = x('img')[0]['src'] base_url = "{0.scheme}://{0.netloc}/".format(urlsplit(thumnail_addr)) print(base_url)#cloudflare else: next_url = x['href'] del xx else: response.close() return next_url,counter while(url != ""): url, counter = scrape(url,counter)