Here's the reproducer.
#!/usr/bin/env python3
import time
import sys
import selenium
import os.path
from packaging import version
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def get_chrome():
if os.path.isfile('/usr/bin/chromium-browser'):
return '/usr/bin/chromium-browser'
elif os.path.isfile('/usr/bin/chromium'):
return '/usr/bin/chromium'
elif os.path.isfile('/usr/bin/chrome'):
return '/usr/bin/chrome'
elif os.path.isfile('/usr/bin/google-chrome'):
return '/usr/bin/google-chrome'
else:
return None
def main():
if version.parse(selenium.__version__) >= version.parse("3.0"):
opts = Options()
opts.binary_location = get_chrome()
opts.add_argument('--headless')
opts.add_argument('--no-sandbox')
opts.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(chrome_options=opts)
driver.maximize_window()
else:
opts = Options()
opts.headless = True
opts.binary_location = get_chrome()
driver = webdriver.Chrome(chrome_options=opts)
driver.maximize_window()
agent = driver.execute_script('return navigator.userAgent')
driver.get("https://complaints.donotcall.gov/complaint/complaintcheck.aspx")
driver.implicitly_wait(2)
driver.quit()
if __name__ == "__main__":
main()
** Attachment added: "Reproducer for Selenium InvalidArgumentException"
https://bugs.launchpad.net/ubuntu/+source/python-selenium/+bug/1833448/+attachment/5271603/+files/test.py
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1833448
Title:
selenium.common.exceptions.InvalidArgumentException: Message: invalid
argument: value must be a non-negative integer
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-selenium/+bug/1833448/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs