0

Bootstrap's JavaScript requires Jquery -> Error Image link

I am creating a python automation program using selenium. My script works fine with chrome, but when i use "headless chrome" it shows some error.

    options = Options()
options.add_argument('headless')
options.add_argument("--disable-gpu")
options.add_argument("--window-size=1200,600")
driver = webdriver.Chrome('C:/users/com/Downloads/chromedriver', options=options)

def mail():
    global i
    search_bar = driver.find_element_by_name("emailList")
    search_bar.send_keys(Keys.CONTROL, 'v')
    search_bar = driver.find_element_by_xpath("/html/body/div[1]/form/button")
    search_bar.click()  // click on submit button on php form
    print("submit", i)
    i += 1
    if i < len(Links):
        driver.execute_script("window.open('');") //opens a new tab
        driver.switch_to.window(driver.window_handles[i]) 

Edit: Maybe

driver.execute_script("window.open('');") //opens a new tab

is causing the error, it works on chrome but not on headless chrome.

Ayush Raj
  • 11
  • 2
  • What error do you see? – undetected Selenium Jun 14 '20 at 15:48
  • It was link error, changed link and got fixed. However THere is a limitation of Headless chrome. copy-paste function does not work – Ayush Raj Jun 14 '20 at 18:53
  • Do you have a unique question for your new requirement? – undetected Selenium Jun 14 '20 at 19:19
  • yes, I need to use clipboard paste "ctrl + v" on headless chrome, which dont work. any other option? and there is a List with name Links = [] in my script, when i will compile my program. I want my program to connect with my server and receive those links and store in the program. How can i do it? – Ayush Raj Jun 14 '20 at 19:51

0 Answers0