I am trying to access an established profile on Chrome in order to navigate to a specific website, but I am encountering an issue with Chrome crashing and displaying error

An issue has been identified: The process started from the location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, leading ChromeDriver to assume that Chrome has crashed.

Below is a code snippet:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.keys   import  Keys
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by  import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time as t

def selenium_config():
    options = Options()
    options.add_argument("--user-data-dir=C:/Users/VIBHAS DUTTA/AppData/Local/Google/Chrome/User Data/Profile 3")
    options.add_argument("profile-directory=Profile 3")
    driver_manager = ChromeDriverManager()                
    chrome_service = Service(driver_manager.install())                       
    driver = webdriver.Chrome(service=chrome_service, options=options)
    return driver


driver = selenium_config()

# driver.get("https://www.google.com")
while True:
            audiotext = input("Enter: ")
            if "search" in audiotext:
                audiotext = audiotext.replace("search", "")
                element = driver.find_element(By.NAME, "q")
                element.clear()
                element.send_keys(audiotext)
                element.send_keys(Keys.ENTER)

I have attempted to add more arguments and options without success. I have also researched on YouTube but found no solution.

Answer №1

Although I managed to resolve the crash issue, the profile I intended to access still remains inaccessible.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Python automation tool to extract reviews from website sidebars using selenium

Recently, I've been exploring the world of review scraping on booking.com. One method I tried was randomly selecting a hotel and using both Selenium and BeautifulSoup to extract reviews. However, my attempts have not been successful as I am not gettin ...

Substitute values in a dataframe using various conditions of varying lengths

When it comes to replacing dataframe values based on conditions of differing lengths, I've found success with conditions of similar length but struggle with longer or more complex conditions. Take a look at the example below: This method is effective ...

What is the process of combining open() with appending mode and seek() in Python when working on Linux systems?

Here is my scenario: with open(file, 'a') as log: #A series of code, some writing to log. log.seek(0) log.write(time.strftime(t_format)) I am encountering an issue with using seek() in append mode. If I switch to 'w' mode, ...

To clear a WebdriveException element, it is necessary for it to be editable by the user

Can someone assist with the following issue: <select class="standard-selection-3" onchange="SuperChanged();" size="8" multiple="multiple" name="super"> <option value="90ddb13f-0989-4433-a17f-4b6438f02f78">windows</option> </select ...

Obtaining a subset of a numpy array based on the maximum value indices returned

I am working with a numpy array in the shape of (3,3) and my goal is to determine the sign of the element that has the maximum absolute value. Here is the array I am working with: X = [[-2.1, 2, 3], [ 1, -6.1, 5], [ 0, 1, 1]] s = numpy.arg ...

What is the best way to organize a list based on an integer string found within the list?

Lately, I've been encountering some challenges with code and I wanted to share it with this fantastic community! My issue revolves around a list of strings that are essentially string-based lists separated by a special character ('~'). Here ...

Creating a scrollable text box in Python Tkinter

I created this code with the intention of quickly pulling and displaying data from Wikipedia. Everything functions well unless the summary from Wiki is too extensive for the box to present all at once. I believed that including sticky = N+S+E+W would resol ...

``Is there a specific situation where pytest fixtures are most appropriate to

Having recently delved into testing, pytest fixtures have caught my attention. However, I'm not entirely clear on when to use them and how they can be beneficial. An illustration of this dilemma can be found in the following code snippet: import pyte ...

Leveraging the power of Python multiprocessing for executing calculations on objects

Looking for a way to efficiently update object attributes through parallel computing? I have multiple objects that require the same computation on their attributes, but they do not share information. The issue lies in the fact that processes within a proce ...

Selenium - Struggling to Retrieve Text from Element (Python)

I'm attempting to retrieve the output of an input from: Unfortunately, I am unable to acquire the desired result despite trying the following methods: result = browser.find_element_by_id("input") result.text result.get_attribute("tex ...

Divide the string based on spaces, except when the space is enclosed in apostrophes

input: "X Y Z ' '" expected result: ['X', 'Y', 'Z', " "] I have attempted several methods utilizing the re module, but my proficiency with regex is limited. ...

Struggling to locate an element within a webpage? Utilize Selenium with Python to simplify the process

Having some trouble scraping this particular page. I am attempting to extract the email icon from these names, but all my attempts have been unsuccessful so far. Any guidance would be greatly appreciated! from selenium import webdriver from bs4 import Be ...

"Using pytest.raises to Capture sqlite3.IntegrityError Errors: A Step-by-Step Guide

I am attempting to capture a sqlite3.IntegrityError error using the pytest.raises() method. Here is some sample code to demonstrate this behavior. import sqlite3 import pytest def anotherFunction(cursor): try: cursor.execute("INSERT INT ...

Python code allowing users to navigate back to the previous page while retaining elements

After my script scrapes the page, it automatically clicks a button if a new element meeting certain criteria is found. Everything works perfectly when there is only one element, but an issue arises when the button click leads to a new page opening. If ther ...

Tips for transforming a pandas dataframe into a dictionary that can be sliced

My pandas data frame df is structured as follows: import pandas as pd data = [[1, 'Jack', 'A'], [1, 'Jamie', 'A'], [1, 'Mo', 'B'], [1, 'Tammy', 'A'], [2, 'JJ', ' ...

Converting a Dataframe or CSV to a JSON object array

Calling all python experts, I have a simple query that needs addressing. Take a look at the data below: 0 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ed959691ab9f92d1dcc0c2">[email protected]</a> 1323916902 ...

Combine dataframes while excluding any overlapping values from the second dataframe

I have two distinct dataframes, A and B. A = pd.DataFrame({'a'=[1,2,3,4,5], 'b'=[11,22,33,44,55]}) B = pd.DataFrame({'a'=[7,2,3,4,9], 'b'=[123,234,456,789,1122]}) My objective is to merge B with A while excluding an ...

The enchanting dance of words ceased as Poetry ran off with Worker.py, only to realize that the file b'/snap/bin/worker.py' was nowhere to be found in the directory

After running the command below in the same directory as the file worker.py: poetry run worker.py I encountered the following error in the terminal: me@LAPTOP-G1DAPU88:~/.ssh/workers-python/workers/composite_key/compositekey$ poetry run worker.py File ...

Transmitting JSON data to a Flask template

I struggled to figure out how to retrieve JSON data from my search results, but I've managed to solve that issue. Now, the challenge is updating my jinja template with the data I fetched. Despite attempting various methods, my lack of experience with ...

Challenge with Jinja2 formatting

How can I declare a fact in ansible using Jinja2? I encountered the following error: Error: template error while templating string: expected token ',', got ':' Here is the code snippet: - set_fact: lb_lstnr_map: [] - name: "Bui ...