1

Here's a simple python code to go to a particular website:

import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.webdriver.common.by import By
import time

profile=webdriver.ChromeOptions()
profile.add_argument('--ignore-certificate-errors')
driver =webdriver.Chrome(r'C:\Utility_Tools\WebDriver\chromedriver.exe')
driver.get('www.google.com')

But since I haven't entered the url so it throws error. Whereas if I use this statement:

driver.get('https://www.google.com/')

Error Disappears. Since my database contains websites without SSL certifications is there any way to browse through them only? Here's my attempt but this too failed:

profile=webdriver.ChromeOptions()
profile.add_argument('--ignore-certificate-errors')
driver =webdriver.Chrome(r'C:\Utility_Tools\WebDriver\chromedriver.exe',options=profile)
driver.get('www.google.com')

The error I trigger each time I run the code is shown below:

errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: invalid argument (Session info: chrome=79.0.3945.130)

5
  • Note that when I use the webpage with proper SSL certification link, the error disappears. Commented Jan 21, 2020 at 6:24
  • so it throws error. What error? Always include the entire error message. Commented Jan 21, 2020 at 7:11
  • I can't tell what you're doing but --disable-web-security makes those go away sometimes Commented Jan 21, 2020 at 23:25
  • Error is mentioned at the end @AMC. Commented Jan 22, 2020 at 4:48
  • Hi @pguardiario, the answer solved my issue. Commented Jan 22, 2020 at 4:48

1 Answer 1

2

The problem is on get(), www.google.com is not a valid url. For not secure you can use http rather than https

driver.get('http://www.google.com')
Sign up to request clarification or add additional context in comments.

5 Comments

Actually Its working with https. What I want to know is that since all my websites are without http tag then how can I figure out the way to browse without specifying http certifications.
@ShivamSahil all websites have http or https, otherwise it's not a valid url. If you store the urls without it just add it in the code 'http://' + 'www.google.com'
@ShivamSahil yes.
@ShivamSahil so even if it has https, will it still work? Make sure you understand what the issue was, https itself has nothing to do with it.
@AMC Actually my issue was without SSL certifications, selenium was not working and error was as shown above. So I needed to know if there's a method to use SSL certification directly. I understand that https has no specific role. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.