Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import bs4
- price={}
- price[npc_price]=0
- price[cmpfy_price]=0
- temp1=0
- temp2=0
- while True:
- national_pc=requests.get("https://nationalpc.in/laptop-memory/adata-premier-8gb-ddr4-3200-so-dimm-latop-memory-module").content
- compify=requests.get("https://compify.in/product/adata-premier-8gb-ddr4-3200mhz-laptop-ram/").content
- npc=bs4.BeautifulSoup(national_pc,"html.parser")
- cmpfy=bs4.BeautifulSoup(compify,"html.parser")
- temp1=float(npc.find('div',{'class':'product-price'}).text[1:].replace(',',""))
- if temp1!=price[npc_price]:
- send_message()
- price[npc_price]=temp1
- temp2=cmpfy.find("whatever")
- if temp2!=price[cmpfy_price]:
- send_message()
- price[cmpfy_price]=temp2
Advertisement
Add Comment
Please, Sign In to add comment