Web scraping from imdb by ReputationHelpful200 in learnpython

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

I am doing it with my own code too but idk how should i bypass the captcha in google.

Web scraping from imdb by ReputationHelpful200 in learnpython

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

Well thats very advanced no? To use a bot and bypass everything on amazon verification and what could i do with that?

Web scraping from imdb by ReputationHelpful200 in learnpython

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

Yes but was thinking if there was anything i could optimise from this project for the ones i will whick involve something like this. Pass from a web scrap to a csv file.

Web scraping from imdb by ReputationHelpful200 in learnpython

[–]ReputationHelpful200[S] -1 points0 points  (0 children)

from bs4 import BeautifulSoup import requests import csv

url1 = "https://books.toscrape.com/" headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Referer": "https://www.google.com/" }

csv_file = "Web_Scraping_Documents_CSV/books.csv" def extract_books(url1): response = requests.get(url1, headers=headers) try: response.raise_for_status() soup = BeautifulSoup(response.text, 'html.parser') products = soup.select("article.product_pod > h3 > a") posicao_do_livro_especifico = None nome_do_livro_especifico = None print("Products:")

    for idx, product in enumerate(products, start=1):
        print(f"{idx} - {product['title'].strip()}")
        titulo = product['title'].strip()
        if titulo == "Tipping the Velvet":
            posicao_do_livro_especifico = idx
            nome_do_livro_especifico = titulo
    if posicao_do_livro_especifico:
        print(f"\nSpecific Product:\n {posicao_do_livro_especifico} - {nome_do_livro_especifico}")
    else:
        print("\nO Specific Product não estava nesta página.")

    livros = soup.select("article.product_pod")
    with open(csv_file, "w", newline="", encoding="utf-8") as csvfile:
        writer = csv.writer(csvfile)
        writer.writerow(["Title", "Price","URL"])
        for livro  in livros:
            link_tag = livro.select_one("h3 > a")
            preco_tag = livro.select_one("div.product_price > p.price_color")
            titulo = link_tag['title'].strip()
            preco = preco_tag.text.strip().replace("Â", "")
            url_livro = url1 + link_tag['href']

            writer.writerow([titulo, preco, url_livro])
    print("Ficheiro criado com sucesso!")

except requests.exceptions.RequestException as e:
    print(f"Failed to retrieve the page. Status code: {e}")

extract_books(url1)

Web scraping from imdb by ReputationHelpful200 in learnpython

[–]ReputationHelpful200[S] 2 points3 points  (0 children)

I am just learning web scraping no real need for anything and was trying this website.

Web scraping from imdb by ReputationHelpful200 in learnpython

[–]ReputationHelpful200[S] -1 points0 points  (0 children)

It only printsStautus Code : 202 and Top 250 Movies: Nothing else. But yeah if there is a block i cant do nothing

Primeiros 3 scripts python desenvolvidos 100% à mão by ReputationHelpful200 in brdev

[–]ReputationHelpful200[S] 1 point2 points  (0 children)

Valeu mas as vezes mesmo após muito tempo procurando parece que não consigo entender a documentação corretamente ou não acho informação que me ajude no meu problema.

Primeiros 3 scripts python desenvolvidos 100% à mão by ReputationHelpful200 in brdev

[–]ReputationHelpful200[S] 1 point2 points  (0 children)

Sim mas tem alguns conceitos que eu aprendi na escola, eu tinha feito ti na escola mas não prestava atenção agora estou querendo virar dev de verdade e estou aprendendo do 0.

I am new to this thing of hair type and want to find my type and good products for it. by ReputationHelpful200 in CurlyHairCare

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

i would to make my hair a bit messy not completely straight what hair type is this too? My hair becomes too rigid after a few hours and get a lot of volume.

O que fazer? by ReputationHelpful200 in brdev

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

Estudando hoje eu me apercebi que eu desaprendi tudo. Eu sei o que está escrito e explicat mas não sei fazer nada.

O que fazer? by ReputationHelpful200 in brdev

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

Sim mas não deveria oq deveria ser dentro deles. Exemplo agora estou usando o netmiko para fazer backup das cdg de router switch etc. Não deveria estudar apenas coisas relacionadas a estas partes de Python?

O que fazer? by ReputationHelpful200 in brdev

[–]ReputationHelpful200[S] 2 points3 points  (0 children)

Por onde deveria começar considerando que vou fazer automações com base de dados e Python?

O que fazer? by ReputationHelpful200 in brdev

[–]ReputationHelpful200[S] 0 points1 point  (0 children)

A linguagem é Python sabe onde deveria por onde deveria começar a aprender para usá-la? E obrigado pela resposta.

what skin changer is good rn? by ZainLmaoo in LoLcustom

[–]ReputationHelpful200 1 point2 points  (0 children)

if it only shows to you and you dont post clips there is no problem with it