headers = { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36", "referer": "https://avtoelon.uz/uz/avto/chevrolet/?price-currency=l"
}
def get_page(url):
site = requests.get(url=url, headers=headers) return site if site.status_code == 200 else False
def parser():
print("Parser ishga tushdi !")
html = get_page("https://avtoelon.uz/uz/avto/chevrolet/?page=l")
htmldom = BeautifulSoup(html.text, "Ixml")
print(htmldom.title.text)
if name == " main " :
parser()
Do'stlaringiz bilan baham: |