th0m45s5helby

Untitled

Jun 14th, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. import requests
  2. import bs4
  3. price={}
  4. price[npc_price]=0
  5. price[cmpfy_price]=0
  6. temp1=0
  7. temp2=0
  8. while True:
  9.     national_pc=requests.get("https://nationalpc.in/laptop-memory/adata-premier-8gb-ddr4-3200-so-dimm-latop-memory-module").content
  10.     compify=requests.get("https://compify.in/product/adata-premier-8gb-ddr4-3200mhz-laptop-ram/").content
  11.     npc=bs4.BeautifulSoup(national_pc,"html.parser")
  12.     cmpfy=bs4.BeautifulSoup(compify,"html.parser")
  13.  
  14.     temp1=float(npc.find('div',{'class':'product-price'}).text[1:].replace(',',""))
  15.  
  16.     if temp1!=price[npc_price]:
  17.         send_message()
  18.         price[npc_price]=temp1
  19.        
  20.     temp2=cmpfy.find("whatever")
  21.  
  22.     if temp2!=price[cmpfy_price]:
  23.         send_message()
  24.         price[cmpfy_price]=temp2
Advertisement
Add Comment
Please, Sign In to add comment