[Python] I am starting web-scraping with python and

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    I am just trying to pick a title of an item of a website and my code its ->

    from bs4 import BeautifulSoup
    import requests

    URL = "https://pauta.com.br/produto/31394"

    headers = {'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36"}

    site = requests.get(URL, headers=headers)

    soup = BeautifulSoup(site.content, 'html.parser')

    #print(soup.prettify())

    title = soup.find('h4', class_ = 'ng-binding')
    print(title)


    Why my output its "none" ? What am I doing wrong?

    Continue reading...

Compartilhe esta Página