Skip to content

Commit

Permalink
mostra pro sor pra ver oque precisa fazer
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-cavano committed Apr 26, 2022
1 parent 6a5f9fc commit 4d7b860
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions webscraping2.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import requests
import schedule
import time
from datetime import datetime
from bs4 import BeautifulSoup

def job():
url1 = requests.get('https://coinmarketcap.com/pt-br/currencies/bitcoin/')
#print(url1.status_code)

htmlBruto1 = url1.content
site = BeautifulSoup(htmlBruto1, 'html.parser')
tagPreco = site.find('div', attrs={'class':'priceValue smallerPrice'})
#print(tagPreco)
preco = tagPreco.find('span')

time = datetime.now()

salvar = [preco.text, str(time)]

print()
print(preco.text)
print(salvar)
print()

schedule.every(10).seconds.do(job)

schedule.every(2).minutes.do(job)
#chedule.every(5).seconds.do(job)

while True:
schedule.run_pending()
time.sleep(1)
#time.sleep(0)

0 comments on commit 4d7b860

Please sign in to comment.