Category : python-3.6

I am trying to use pexpect module (version 4.8.0) with Python 3.6.8. I get an error TypeError: cannot use a string pattern on a bytes-like object Here is my code: child = pexpect.spawn(path, args, logfile=buff, timeout=self.PASSPHRASE_TIMEOUT, **kwargs) while True: idx = child.expect([self.PASSPHRASE_RE,pexpect.EOF]) if idx == 0: child.sendline(passphrase) elif idx == 1: child.wait() break I am ..

Read more

This code not working in background , I mean headless mode i used to run background options.add_argument(‘–no-sandbox’) options.add_argument(‘headless’) this is code which errored , def get_data(): last = "" switch_button = driver.find_element_by_xpath( ‘//*[@id="body-content"]/div[2]/div/div[1]/div/div[2]/div[1]/section[2]/div’).click() error is selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="body-content"]/div[2]/div/div[1]/div/div[2]/div[1]/section[2]/div"} what’s wrong ? without headless mode working good , when ..

Read more