recursive

#!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()

    if (next_url == ""):
        return next_url,counter
    else:
        return scrape(next_url,counter)

url, counter = scrape(url,counter)
Edit
Pub: 12 May 2022 08:26 UTC
Edit: 18 May 2022 13:57 UTC
Views: 285