Created
October 20, 2021 17:14
-
-
Save dually8/434455c88db64b729e6ecf85aa1aadb6 to your computer and use it in GitHub Desktop.
Get slickdeals links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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