what is the procedure to run chrome driver in selenium in pythonanywhere
what is the procedure to run chrome driver in selenium in pythonanywhere
Missing or invalid capabilities (Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 5.15.0-1044-aws x86_64)
i have already upgraded selenium , but unable to initialize driver
See the help page for example code and make sure you can get that working first.
def D_CIBIL(request): chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") driver = webdriver.Chrome(options=chrome_options) driver.get('https://commercial.cibil.com/enquiry/#/login') time.sleep(20) login_id_input = driver.find_element(By.NAME, "loginId") login_id_input.send_keys('IN80230001_CMM02') password = driver.find_element(By.NAME, "passwd") password.send_keys("Bharat@$123456") login = driver.find_element(By.NAME, "login") login.click() delay = 3 try: myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'IdOfMyElement'))) print "Page is ready!" except TimeoutException: print "Loading took too much time!" order = driver.find_element(By.PARTIAL_LINK_TEXT, "Order") order.click() workbook = openpyxl.load_workbook('Excel_CIBIL.xlsx') sheet = workbook.active
I used the code but i am getting no such element: Unable to locate element: {"method":"css selector","selector":"[name="loginId"]"}
I tested in local environment , it just worked fine
Pls help out
Does increasing the sleep change anything?
I increased to 50 after the loading of website , but it is not working
Can you see the element when you access the page through your browser?
Yes i can see
https://commercial.cibil.com/enquiry/#/login this is the site
I'm getting a 520 error when I try to access it
https://commercial.cibil.com/enquiry/#/login
Pls access , it is correct link
Check the HTML that you get when you load the page on PythonAnywhere. Then you can see what elements are actually in the page that selenium is getting.
This is not working , please provide solution
What is not working?
I am still getting nosuchelement found error
But did you check the HTML?
I have checked , all elements are there , but my program unable to locate it , it is working fine in local environment , pls resolve
If the elements are there, then you need to debug you code to make sure that it is looking at the right element.