SShadowS

Untitled

Oct 7th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. from pushbullet import Pushbullet
  4.  
  5. pb = Pushbullet('KEY HERE')
  6.  
  7. URL = 'https://www.komplett.dk/search?q=3090'
  8. page = requests.get(URL)
  9.  
  10. soup = BeautifulSoup(page.content, 'html.parser')
  11.  
  12. allItems = soup.find_all(class_='product-list-item')
  13.  
  14. for item in allItems:
  15.     StockStatus = item.find_all(class_='stockstatus-stock-details')
  16.     if StockStatus:
  17.         ItemInfo = item.find(class_='product-link image-container')
  18.         ItemLink = 'https://www.komplett.dk' + ItemInfo['href']
  19.         print(ItemInfo['title'] + ' er på lager')
  20.         print(ItemLink)
  21.         push = pb.push_link(ItemInfo['title'], ItemLink)
Add Comment
Please, Sign In to add comment