Compare commits

...
This repository has been archived on 2020-04-03. You can view files and clone it, but cannot push or open issues or pull requests.

5 Commits
master ... test

Author SHA1 Message Date
Andreas Zweili 6c043631b1 add the wheel package to the requirements 2017-04-24 22:32:44 +02:00
Andreas Zweili f3f8a9337c add a sha-bang to the install script 2017-04-24 21:45:02 +02:00
Andreas Zweili e1586ceefe Add sleep(10) to while loop 2017-03-16 22:18:49 +01:00
Andreas Zweili 30471ca277 prepare for reddit 2017-03-16 12:54:26 +01:00
Andreas Zweili 2129293de7 test 2017-03-16 12:53:41 +01:00
3 changed files with 14 additions and 9 deletions

View File

@ -1,3 +1,4 @@
#!/bin/bash
sudo apt-get install python3 python3-pip qt5-default libqt5webkit5-dev\
build-essential xvfb libxml2-dev libxslt1-dev
python3 -m venv ../price_checker

View File

@ -54,6 +54,7 @@ class Website(object):
session = dryscrape.Session()
session.set_attribute('auto_load_images', False)
session.visit(self.url)
print(session.status_code())
page = session.body()
self.soup = BeautifulSoup(page, "lxml")
@ -107,13 +108,15 @@ class Configuration():
dryscrape.start_xvfb()
settings = Configuration()
email = Email(settings.recipient_address)
website = Website(settings.url)
website.get_page()
if website.extract_price() < settings.price:
email.connecting(settings.smtp_server, settings.smtp_port)
email.login(settings.sender_address, settings.password)
email.sending(settings.sender_address, settings.url)
sys.exit(0)
else:
sys.exit(0)
while True:
website = Website(settings.url)
website.get_page()
if website.extract_price() < settings.price:
email.connecting(settings.smtp_server, settings.smtp_port)
email.login(settings.sender_address, settings.password)
email.sending(settings.sender_address, settings.url)
sys.exit(0)
else:
print("No Match")
time.sleep(10)

View File

@ -1,3 +1,4 @@
wheel
beautifulsoup4
requests
lxml