#!/usr/bin/env python3 from pyvirtualdisplay import Display from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup import time, json, configparser, sys, os, argparse, textwrap from json import JSONEncoder from sys import argv display = Display(visible=0, size=(1024,768)) display.start() def find_string(instring): a = "" with webdriver.Firefox() as browser: browser.get("https://www.southernsavers.com/publix-weekly-ad-deals/") #wait = WebDriverWait(browser, 8) #wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "selectAllLink"))).click() time.sleep(15) # wait 15 seconds for good measure a = browser.page_source #return browser.page_source return a if __name__ == "__main__": loop1()