Comments (4)
Can I submit my code
from pyautomate.
You can but make sure it passes PEP8. http://pep8online.com/ and solves the above problem statement. Thank you have a great day :)
from pyautomate.
import bs4 as bs
import sys
import schedule
import time
import urllib.request
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QUrl
import winsound
frequency = 2500 # Set Frequency To 2500 Hertz
duration = 1000 # Set Duration To 1000 ms == 1 second
class Page(QWebEnginePage):
def __init__(self, url):
self.app = QApplication(sys.argv)
QWebEnginePage.__init__(self)
self.html = ''
self.loadFinished.connect(self._on_load_finished)
self.load(QUrl(url))
self.app.exec_()
def _on_load_finished(self):
self.html = self.toHtml(self.Callable)
print('Load finished')
def Callable(self, html_str):
self.html = html_str
self.app.quit()
def exact_url(url):
index = url.find("B0")
index = index + 10
current_url = ""
current_url = url[:index]
return current_url
def mainprogram():
url = "https://www.amazon.in/Airtel-4G-Hotspot-E5573Cs-609-Portable/dp/B06WV9WR4Z"
exacturl = exact_url(url) # main url to extract data
page = Page(exacturl)
soup = bs.BeautifulSoup(page.html, 'html.parser')
js_test = soup.find('span', id ='priceblock_ourprice')
if js_test is None:
js_test = soup.find('span', id ='priceblock_dealprice')
str = ""
for line in js_test.stripped_strings :
str = line
# convert to integer
str = str.replace(", ", "")
current_price = int(float(str))
your_price = 600
if current_price < your_price :
print("Price decreased book now")
winsound.Beep(frequency, duration)
else:
print("Price is high please wait for the best deal")
def job():
print("Tracking....")
mainprogram()
main code
schedule.every(1).minutes.do(job)
while True:
schedule.run_pending()
time.sleep(1)
from pyautomate.
Hey Issue a PR after you run the code in PEP8 online. My Bot will handle checking and stuff make sure to create a new file and put the code along with a README file (this file must contain SC of the code in-action, code explanation, and How to use the script)
from pyautomate.
Related Issues (19)
- Discord Music bot HOT 7
- contribute-list HOT 6
- Python Linter HOT 2
- Book Downloader HOT 3
- MP4 to MP3 HOT 6
- Welcomeee
- How cool it would be to automate your Hackerrank submissions. HOT 2
- Speaking website HOT 5
- ✨ Leave a Star ✨
- Whatsapp Automation HOT 2
- Linkdln Automation HOT 4
- PDF to Audio Book HOT 4
- adding voice control for whatsapp HOT 15
- Stock Price Tracker HOT 1
- Typos in README.md HOT 2
- Issue Notifier Discord Bot HOT 4
- Test HOT 1
- Test2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyautomate.