import requests,washer def start(): with open('content.txt','w+'): pass header = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' } i = 1 while i <= 10: url = f'https://www.pearvideo.com/popular_loading.jsp?reqType=41&categoryId=&start={i*10}&sort={i*10}' content = requests.get(url,headers = header).text with open('content.txt','a+',encoding='utf-8') as f: f.write(content) i += 1