I have a problem clicking the facebook accept cookies button.
Thank you for your help
Thank you for your help
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time
service = Service(executable_path="chromedriver.exe")
driver = webdriver.Chrome(service=service)
driver.get("https://www.facebook.com/100071044756969/videos/1180978660013442")
time.sleep(5)
driver.find_elements(By.XPATH, "//button[contains(string(), 'Allow essential and optional cookies')]")[0].click()
driver.quit()
Larz60+ write Apr-07-2024, 12:38 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Tags have been added for you this time. Please use BBCode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Tags have been added for you this time. Please use BBCode tags on future posts.
