Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # vim: ai ts=4 sts=4 et sw=4
- # Filename: lotofacil.py
- # Author: Sergio Araujo
- # este script já funciona mas quero altera-lo para atender a dois propósitos:
- # imprimir somente números
- # imprimir somente os 12 primeiros
- from bs4 import BeautifulSoup
- import requests
- #url = input("Digite o link da página: ")
- ## page = requests.get('https://www.dataquest.io/blog/web-scraping-tutorial-python/')
- url = 'https://asloterias.com.br/numeros-mais-sorteados-lotomania'
- ## when the website does not allow command line access
- headers = {'User-Agent': 'Mozilla/5.0'}
- page = requests.get(url, headers=headers)
- soup = BeautifulSoup(page.content, 'html.parser')
- mydivs = soup.find_all("div", {"class": "tabela_zebrada"})
- # ## print all page links
- # for link in soup.find_all("a"):
- # print(link.get("href"))
- for i in mydivs:
- print(i.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement