This file contains hidden or 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
| from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| # Set chrome options object so you can set the size and headless preference | |
| chrome_options = Options() | |
| chrome_options.add_argument("--headless") | |
| chrome_options.add_argument("--window-size=1920x1080") | |
| # Load the driver | |
| chrome_driver = "chromedriver" |
This file contains hidden or 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
| import requests | |
| from bs4 import BeautifulSoup | |
| from proxymanager import ProxyManager | |
| import time | |
| proxy_manager = ProxyManager('proxies.txt') | |
| headers = { | |
| 'Accept-Encoding': 'gzip, deflate, br', | |
| 'Accept-Language': 'en-US,en;q=0.9', | |
| 'Upgrade-Insecure-Requests': '1', |
This file contains hidden or 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
| import requests | |
| from bs4 import BeautifulSoup | |
| import time | |
| def update(): | |
| request = requests.get('https://mathewsteininger.com/sample-product') | |
| html = request.content | |
| soup = BeautifulSoup(html, 'html.parser') | |
| # Monitor this tag to check stock changes | |
| stock = soup.find("button", {"id": "availability"}) |