Skip to content

Instantly share code, notes, and snippets.

@dually8
Created October 20, 2021 17:14
Show Gist options
  • Save dually8/434455c88db64b729e6ecf85aa1aadb6 to your computer and use it in GitHub Desktop.
Save dually8/434455c88db64b729e6ecf85aa1aadb6 to your computer and use it in GitHub Desktop.
Get slickdeals links
# python -m pip install beautifulsoup4
# python -m pip install lxml
# python -m pip install requests
import bs4
import requests
def lookUpDeals():
slickDealsSite = requests.get('https://slickdeals.net/computer-deals/')
slickDealsSite.raise_for_status()
soup = bs4.BeautifulSoup(slickDealsSite.text, features="lxml")
potentialDeals = soup.select('a.itemTitle')
for i in range(len(potentialDeals)):
text = potentialDeals[i].string
isNVME = text.lower().find('nvme') > -1
is2TB = text.lower().find('2tb') > -1
if isNVME and is2TB:
print(f"https://slickdeals.net{potentialDeals[i].get('href')}")
if __name__ == "__main__":
lookUpDeals()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment