blob: 9a35dd304b649ad5a557cf199bd9004f8364940c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/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()
|