Python: Selenium webdriver Chrome opens up browser but not the site selected

NewDev

I have just downloaded Anaconda (v 1.7.2) and spyder (Python 3.7.6). I have chrome (Version 81.0.4044.92 64-bit) Selenium version 3.141.0

When I write the code below I get the response that chrome opens up a new instance and a tab, but only the starting page, it never opens up the site I have pointed out. I have tried to close all other chrome instances also but that didn't help. I have added the following to the system environment variables C:\Users\aaa.bbb\Anaconda3\Scripts; c:\users\aaa.bbb\anaconda3\lib\site-packages\chromedriver;


from selenium import webdriver

from bs4 import BeautifulSoup

import pandas as pd

import time

driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")

driver.get('http://www.aftonbladet.se');

time.sleep(3)

driver.quit()

The response I get in spyder is:

runfile('C:/Users/aaa.bbb/.spyder-py3/temp.py', wdir='C:/Users/aaa.bbb/.spyder-py3')
Traceback (most recent call last):

  File "C:\Users\aaa.bbb\.spyder-py3\temp.py", line 8, in <module>
    driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")

  File "C:\Users\aaa.bbb\Anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()

  File "C:\Users\aaa.bbb\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 98, in start
    self.assert_process_still_running()

  File "C:\Users\aaa.bbb\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 111, in assert_process_still_running
    % (self.path, return_code)

WebDriverException: Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0
SeleniumUser002

Please download latest chrome driver which support to your browser version : you can download Latest Chrome driver from here, Here r denotes relative path::

from selenium import webdriver
driver = webdriver.Chrome(executable_path=r" path to your chromedriver.exe")
driver.maximize_window()
baseUrl = "https://www.google.com"
driver.get(baseUrl)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Selenium opens up chrome not signed into Chrome account

python selenium opens new browser

How to open a fully functioning chrome browser using selenium WebDriver with python?

Python Selenium Chrome Webdriver

Python chrome opens with “Data;” with selenium

selenium WebDriver UrlChecker$TimeoutException, opens the browser and then never navigating to the link

What are the steps to instantiate the chrome browser in Selenium Webdriver?

Chrome browser opens and closes immediately after it runs - Selenium web driver

Chrome browser closes after running selenium chrome webdriver

Site recognizing Python Selenium Webdriver on multiple pages

How to switch between different chrome browser window opened by different WebDriver using selenium in Python?

Selenium Python browser=webdriver.Firefox() error

Chrome opens with "Data;" with selenium

Radio button isSelected() returns false for Selenium Webdriver on Chrome browser

Could not able to launch chrome browser using the selenium webdriver

Python Selenium While Loop only opens browser at first

Python Selenium - Script opens an extra window before closing the browser

--headless is not an option in chrome webdriver for selenium python

Python selenium with chrome webdriver - change user agent

Handle notifications in Python + Selenium Chrome WebDriver

Selenium chrome webdriver not able to locate elements in python

Tweet using Selenium Python chrome webdriver

Issues with selenium in Python (Maybe installing chrome webdriver)

Error using Selenium Chrome Webdriver with python

Trying with Selenium + Excel VBA to scrape code from a site in Chrome Browser

Selenium opens browser but returns with an error

Start Chrome browser in webdriver

Chrome opens website and Immediately Closes when Using Selenium and Python

Selenium - C# - Chrome - Your connection to this site is not private pop up