-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mostra pro sor pra ver oque precisa fazer
- Loading branch information
1 parent
6a5f9fc
commit 4d7b860
Showing
1 changed file
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |