-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
25 lines (20 loc) · 693 Bytes
/
test.py
File metadata and controls
25 lines (20 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from bs4 import BeautifulSoup #for html parsing
import requests #for getting the site
from twilio.rest import Client #for sending the message
import time #for delays
# from variables import * #import your variables from variables.py
import html2text
url = 'https://hmccree.github.io/HolidayProject2018/'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
text = str(soup)
web_text = html2text.html2text(text)
print(web_text)
time.sleep(60)
page_new = requests.get(url)
soup_new = BeautifulSoup(page_new.content, 'html.parser')
text_new = str(soup_new)
web_text_new = html2text.html2text(text_new)
print(web_text_new)
print('equal:')
print(web_text == web_text_new)