-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython code
More file actions
21 lines (19 loc) · 740 Bytes
/
python code
File metadata and controls
21 lines (19 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--disable-extensions")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--no-sandbox")
options.add_experimental_option("prefs", {"download.default_directory":"/databricks/driver"})
driver = webdriver.Chrome(chrome_options=options)
driver.implicitly_wait(5)
import datetime
today = datetime.datetime.now()
past_date = today - datetime.timedelta(days=30)
today = datetime.datetime.strftime(today, "%m/%d/%Y")
past_date = datetime.datetime.strftime(past_date, "%m/%d/%Y")
print("today - ", today)
print("past_date -", past_date)
url = "https://xyz.com/"
driver.get(url)
driver.implicitly_wait(5)