Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ from selenium.webdriver.common.by import By
|
|
| 3 |
from selenium.webdriver.common.keys import Keys
|
| 4 |
import time
|
| 5 |
from time import sleep
|
|
|
|
| 6 |
|
| 7 |
def main():
|
| 8 |
# Set up Facebook login account name and password
|
|
@@ -21,10 +22,10 @@ def main():
|
|
| 21 |
images_list = ['C:/Users/OEM/Pictures/sample1.jpg','C:/Users/OEM/Pictures/sample2.jpg']
|
| 22 |
|
| 23 |
# Login Facebook
|
| 24 |
-
chrome_options =
|
| 25 |
prefs = {"profile.default_content_setting_values.notifications" : 2}
|
| 26 |
-
chrome_options.add_experimental_option("prefs",prefs)
|
| 27 |
-
driver = webdriver.Chrome(
|
| 28 |
driver.get('https://www.facebook.com')
|
| 29 |
emailelement = driver.find_element(By.XPATH,'//*[@id="email"]')
|
| 30 |
emailelement.send_keys(account)
|
|
|
|
| 3 |
from selenium.webdriver.common.keys import Keys
|
| 4 |
import time
|
| 5 |
from time import sleep
|
| 6 |
+
from selenium.webdriver.chrome.options import Options
|
| 7 |
|
| 8 |
def main():
|
| 9 |
# Set up Facebook login account name and password
|
|
|
|
| 22 |
images_list = ['C:/Users/OEM/Pictures/sample1.jpg','C:/Users/OEM/Pictures/sample2.jpg']
|
| 23 |
|
| 24 |
# Login Facebook
|
| 25 |
+
chrome_options = Options() # Use the Options class
|
| 26 |
prefs = {"profile.default_content_setting_values.notifications" : 2}
|
| 27 |
+
chrome_options.add_experimental_option("prefs", prefs)
|
| 28 |
+
driver = webdriver.Chrome(options=chrome_options) # Pass 'options'
|
| 29 |
driver.get('https://www.facebook.com')
|
| 30 |
emailelement = driver.find_element(By.XPATH,'//*[@id="email"]')
|
| 31 |
emailelement.send_keys(account)
|