Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98411

What is required to pass URL as arguments in selenium python

$
0
0

I'm writing a selenium python script for automation. Want to pass IP as an argument to create URLs to be used in the script.

node_ip = sys.argv[1]
app_url = str("https//"+node_ip+":5200/admin/")
def site_login():
    browser.get(app_url)

But when i run the script i get the following error :

# python3 test.py 192.168.20.10
  File "test.py", line 81, in <module>
    site_login()
  File "test.py", line 33, in site_login
    browser.get(app_url)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
  (Session info: headless chrome=78.0.3904.97)

Could you help fix this ?


Viewing all articles
Browse latest Browse all 98411

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>