#!/usr/bin/pythonimport sysfrom selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsfrom selenium.webdriver.chrome.service import Servicefrom webdriver_manager.chrome import ChromeDriverManagerfrom selenium.webdriver.common.by import Bydef main(url): options = Options() options.add_argument(‘–headless’) options.add_argument(‘–no-sandbox’) options.add_argument(‘–disable-dev-shm-usage’) driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) driver.get(url) # BBC COOKIES driver.add_cookie({“name”: “ckns_explicit”, “value”: “2”}) driver.add_cookie({“name”: “ckns_policy”, “value”: “111”}) driver.add_cookie({“name”: “ckns_policy_exp”, “value”: “9747300802117”}) body = driver.find_element(By.TAG_NAME, ‘body’) print(body.text) driver.close()if __name__ == “__main__”: if len(sys.argv) […]
You must be logged in to post a comment.